aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
Commit message (Collapse)AuthorAgeFilesLines
* LibTomMath: Use 64-bit mode for mp_digitJouni Malinen2012-06-091-0/+8
| | | | | | | For 64-bit x86 builds, enable 64-bit mode to optimize bignum operations with the internal LibTomMath version. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-1130-240/+60
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add support for SHA256-based cipher suites from RFC 5246Jouni Malinen2011-11-274-2/+41
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Update file headers to include TLS v1.2 supportJouni Malinen2011-11-2710-11/+11
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Include TLS v1.1 and v1.2 support in library buildJouni Malinen2011-11-271-0/+2
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Allow TLS v1.2 to be negotiatedJouni Malinen2011-11-271-0/+4
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add TLS v1.2 style CertificateVerify functionalityJouni Malinen2011-11-273-1/+155
| | | | | | | | Add support for generating and verifying RFC 3447 RSASSA-PKCS1-v1_5 style DigestInfo for TLS v1.2 CertificateVerify. For now, this is hardcoded to only support SHA256-based digest. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add SHA256-based verify_data derivation for TLS v1.2Jouni Malinen2011-11-274-4/+88
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Maintain SHA256-based hash values for TLS v1.2Jouni Malinen2011-11-272-0/+32
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add build configuration for TLS v1.2 supportJouni Malinen2011-11-272-0/+20
| | | | | | | | | This allows the internal TLS implementation to be built for TLS v1.2 support. In addition to the build option, this changes the TLS PRF based on the negotiated version number. Though, this commit does not yet complete support for TLS v1.2. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Assume explicit IV for TLS v1.1 and newerJouni Malinen2011-11-271-2/+2
| | | | | | This is needed to allow TLS v1.2 to be supported. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Increase maximum MAC key from 20 to 32 octetsJouni Malinen2011-11-271-1/+1
| | | | | | | This is in prepartion of adding support for SHA256-based operations with TLS v1.2. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Pass version to tls_prf() in preparation for new PRFsJouni Malinen2011-11-278-12/+22
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Rename tls_prf() to tls_prf_sha1_md5()Jouni Malinen2011-11-272-0/+11
| | | | | | | | Prepare for multiple TLS PRF functions by renaming the SHA1+MD5 based TLS PRF function to more specific name and add tls_prf() within the internal TLS implementation as a wrapper for this for now. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add helper functions for version number handlingJouni Malinen2011-11-274-7/+33
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add a debug information on unsupported private key formatJouni Malinen2011-11-271-0/+7
| | | | | | | Provide easier to understand reason for failure to use the old OpenSSL encrypted private key format. Signed-hostap: Jouni Malinen <j@w1.fi>
* Use NULL instead of 0 for pointersJouni Malinen2011-11-181-1/+1
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Mark local functions staticJouni Malinen2011-11-182-2/+2
| | | | | | These functions are not used outside the file in which they are defined. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Fix double-free on error pathJouni Malinen2011-11-131-1/+1
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Add preliminary support for partial message processingJouni Malinen2011-11-133-45/+113
| | | | | | | Reassemble partial TLS records to make the internal TLS client implementation more convenient for stream sockets. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Fix block cipher padding validationJouni Malinen2011-11-131-3/+3
| | | | | | | | | The padding validation was done on the last padding-length octets in the buffer which misses the first padding octet (the last octet is the padding length). Fix the starting offset for the comparison loop to get the first octet verified. [Bug 420] Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Clean up TLS record layer processingJouni Malinen2011-11-053-60/+140
| | | | | | | | | | Return number of user input bytes from tlsv1_record_receive() to move this detail into the proper record layer processing. In addition, ignore unknown content types at record layer and allow processing to continue after warning level TLS alerts to provide minimal workaround for closure alerts. Signed-hostap: Jouni Malinen <j@w1.fi>
* TLS: Validate RSA ClientKeyExchange length fieldJouni Malinen2011-10-231-5/+13
| | | | | Instead of using implicit length based on the received buffer, validate RSA ClientKeyExchange based on the explicit length field.
* TLS: Add support for TLS v1.1 (RFC 4346) with internal TLSJouni Malinen2011-09-259-32/+106
| | | | | This is disabled by defautl and can be enabled with CONFIG_TLSV11=y build configuration parameter.
* TLS: Do not enforce in-place processing in tlsv1_record_send()Jouni Malinen2011-09-256-92/+95
| | | | | | In preparation for record layer format changes, modify tlsv1_record_send() to use separate buffers for payload and the output message.
* TLS: Add protection against record layer CBC attacksJouni Malinen2011-09-251-9/+26
| | | | | | | | Instead of using separate bad_record_mac and decryption_failed alerts, use only bad_record_mac alert regardless of how the CBC decryption failed. This provides less information to attackers that could modify packets. In addition, instead of returning immediately on error, run through the MAC check to make timing attacks more difficult.
* TLS: Avoid unnecessary copying of encrypted data at record layerJouni Malinen2011-09-251-18/+22
| | | | | | When the received data will be decrypted, there is no need to first copy it and then handle decryption in-place when decryption step can take care of both operations.
* TLS: Fix record layer protocol version validationJouni Malinen2011-09-251-3/+8
| | | | | | | TLS v1.0 and v1.1 RFCs were not exactly clear on the use of the protocol version in record later. As such, accept any {03,xx} value to remain compatible with existing implementations and new protocol versions.
* Fix typos found by codespellPavel Roskin2011-09-221-6/+6
| | | | Signed-off-by: Pavel Roskin <proski@gnu.org>
* TLS: Reorder certificates if needed when reading themJouni Malinen2011-08-041-3/+15
| | | | | | | The internal TLS implementation assumes that the certificate chain is ordered by issuer certificate following the certificate that it signed. Add the certificates to the chain in suitable order when loading multiple certificates.
* TLS: Add support for tls_disable_time_checks=1 in client modeJouni Malinen2011-07-057-13/+23
| | | | | | This phase1 parameter for TLS-based EAP methods was already supported with GnuTLS and this commit extends that support for OpenSSL and the internal TLS implementation.
* Increase internal TLSs client key exchange bufferChristian Lamparter2011-02-211-1/+1
| | | | | | | | | | | | | | | | | This patch fixes a problem I had when I tried to connect an embedded system [wpa_supplicant, CONFIG_TLS=internal] to my TLS secured network. TLSv1: Send CertificateVerify TLSv1: CertificateVerify hash - hexdump(len=36): ha .. ha PKCS #1: pkcs1_generate_encryption_block - Invalid buffer lengths \ (modlen=512 outlen=454 inlen=36) It turned out that a fixed 1000 byte message buffer was just a little bit too small for the 4096 bit RSA certificates I'm using. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
* Annotate places depending on strong random numbersJouni Malinen2010-11-242-5/+7
| | | | | | | | | | | | | This commit adds a new wrapper, random_get_bytes(), that is currently defined to use os_get_random() as is. The places using random_get_bytes() depend on the returned value being strong random number, i.e., something that is infeasible for external device to figure out. These values are used either directly as a key or as nonces/challenges that are used as input for key derivation or authentication. The remaining direct uses of os_get_random() do not need as strong random numbers to function correctly.
* Internal TLS: Fix X.509 name handling to use sequency of attributesJouni Malinen2010-05-252-95/+110
| | | | | | There may be more than one attribute of same type (e.g., multiple DC attributes), so the code needs to be able to handle that. Replace the fixed structure with an array of attributes.
* Internal TLS: Add domainComponent parser for X.509 namesJouni Malinen2010-05-252-0/+19
|
* Remove unnecessary SUBDIRS loops from src/*/MakefileJouni Malinen2010-04-171-1/+0
| | | | | | There are no subdirectories in any of these directories or plans for adding ones. As such, there is no point in running the loop that does not do anything and can cause problems with some shells.
* Move asn1_test.c into tests subdirectory and split it in twoJouni Malinen2009-12-061-210/+0
| | | | | | | The new test-asn1 and test-x509 tools are built using libraries from src/{utils,crypto,tls}. Currently, cross dependencies between crypto and tls are still preventing the test-x509 from being linked properly.
* Add rules for building src/tls/libtls.a and use it with eap_exampleJouni Malinen2009-12-062-3/+33
| | | | | | | | | eap_example is now using src/crypto/libcrypto.a and src/tls/libtls.a instead of providing own rules for building the files for these components. TLS library selection is temporarily disabled for eap_example (it will be built using internal crypto/TLS), but the configuration option for this will eventually be restored with a new libcrypto.a configuration option.
* Include functionality to support EAP-FAST unconditionallyJouni Malinen2009-12-065-23/+0
| | | | | | | | | | Clean up the internal TLS implementation by removing conditional build blocks for (mostly) EAP-FAST specific functionality. This will increase the size a big for non-EAP-FAST builds, but is quite helpful in making src/tls/libtls.a with single build options. If the potential size reduction is considered significant in the future, this can be reconsider with a more library compatible way (e.g., external file with registration function, etc.).
* Remove unneeded CONFIG_INTERNAL_X509 and NEED_SHA256 definesJouni Malinen2009-12-063-63/+0
|
* Remove unnecessary definesJouni Malinen2009-12-051-2/+0
| | | | | | | | | The following defines are not really needed in most places, so remove them to clean up source code and build scripts: EAP_TLS_FUNCS EAP_TLS_OPENSSL EAP_TLS_GNUTLS CONFIG_TLS_INTERNAL
* Remove src/crypto from default include pathJouni Malinen2009-11-2913-25/+24
| | | | | | In addition, start ordering header file includes to be in more consistent order: system header files, src/utils, src/*, same directory as the *.c file.
* Fix a typo in a commentJouni Malinen2009-11-211-1/+1
|
* Move PKCS# {1,5,8} functionality into separate filesJouni Malinen2009-10-176-0/+704
| | | | | | This functionality fits better with src/tls (i.e., internal TLS implementation), so move it there to make crypto_internal.c more of a wrapper like other crypto_*.c files.
* TLS: Replace set_key helpers to return key instead of status codeJouni Malinen2009-10-171-19/+21
| | | | | The status code was not being used anyway, so it is simpler to just return the key as is done in crypto functions.
* Add support for PKCS #5 encrypted PKCS #8 keys with internal cryptoJouni Malinen2009-10-171-5/+36
| | | | | | Private keys can now be used in either unencrypted or encrypted PKCS #8 encoding. Only the pbeWithMD5AndDES-CBC algorithm (PKCS #5) is currently supported.
* Internal TLS: Add support for unencrypred PKCS#8 private keys in PEMJouni Malinen2009-10-161-7/+16
| | | | | | | Recognize the PEM header "BEGIN PRIVATE KEY" as base64-decode the data to be able to use PEM encoded, unencrypted PKCS#8 private keys with the internal TLS implementation. Previously, only DER encoding of the PKCS#8 private key was supported.
* Reject X.509 certificate strings with embedded NUL charactersJouni Malinen2009-08-231-0/+31
| | | | | | | | | | | | | These could, at least in theory, be used to generate unexpected common name or subject alternative name matches should a CA sign strings with NUL (C string termination) in them. For now, just reject the certificate if an embedded NUL is detected. In theory, all the comparison routines could be made to compare these strings as binary blobs (with additional X.509 rules to handle some exceptions) and display NUL characters somehow. Anyway, just rejecting the certificate will get rid of potential problems with the C string getting terminated and it should not really be used in certificates, so this should not break valid use cases.
* Support PEM format RSA private key with internal TLS implementationJouni Malinen2009-08-161-0/+29
|
* Add root .gitignore file to cleanup ignore listsJouni Malinen2009-06-291-1/+0
| | | | | | This removes need for local configuration to ignore *.o and *~ and allows the src/*/.gitignore files to be removed (subdirectories will inherit the rules from the root .gitignore).