summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* valgrind: check if session ticket key is used without initializationtmp-totp-initDaiki Ueno2020-06-032-1/+12
| | | | | | | | This adds a valgrind client request for session->key.session_ticket_key to make sure that it is not used without initialization. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* stek: differentiate initial state from valid time window of TOTPDaiki Ueno2020-06-031-12/+5
| | | | | | | | | There was a confusion in the TOTP implementation in stek.c. When the mechanism is initialized at the first time, it records the timestamp but doesn't initialize the key. This removes the timestamp recording at the initialization phase, so the key is properly set later. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'tmp-known-certs' into 'master'Daiki Ueno2020-05-314-35/+87
|\ | | | | | | | | _gnutls_pkcs11_verify_crt_status: check validity against system cert See merge request gnutls/gnutls!1271
| * x509: trigger fallback verification path when cert is expiredDaiki Ueno2020-05-311-5/+7
| | | | | | | | | | | | | | | | | | gnutls_x509_trust_list_verify_crt2 use the macro SIGNER_OLD_OR_UNKNOWN to trigger the fallback verification path if the signer of the last certificate is not in the trust store. Previously, it doesn't take into account of the condition where the certificate is expired. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * _gnutls_pkcs11_verify_crt_status: check validity against system certDaiki Ueno2020-05-313-30/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To verify a certificate chain, this function replaces known certificates with the ones in the system trust store if possible. However, if it is found, the function checks the validity of the original certificate rather than the certificate found in the trust store. That reveals a problem in a scenario that (1) a certificate is signed by multiple issuers and (2) one of the issuers' certificate has expired and included in the input chain. This patch makes it a little robuster by actually retrieving the certificate from the trust store and perform check against it. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* | Merge branch 'nowincrypt' into 'master'Dmitry Baryshkov2020-05-313-1/+93
|\ \ | |/ |/| | | | | use bcrypt for the windows random generator instead of wincrypt See merge request gnutls/gnutls!1255
| * win32: use bcrypt instead of CryptoAPI on Vista+ for random numbersSteve Lhomme2020-05-283-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | CryptoAPI is a deprecated API [1] that is forbidden in UWP builds. Rewrite the CryptoAPI calls in bcrypt. bcrypt is used instead of CryptoAPI when targeting Windows Vista and above. https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptdecrypt Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
* | Merge branch 'add-aes192-gcm' into 'master'Dmitry Baryshkov2020-05-3013-0/+122
|\ \ | | | | | | | | | | | | lib: add support for AES-192-GCM See merge request gnutls/gnutls!1267
| * | lib: add support for AES-192-GCMDmitry Baryshkov2020-05-2713-0/+122
| | | | | | | | | | | | | | | | | | Add support for AES-192 in GCM mode. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | | Merge branch 'tmp-fileio' into 'master'Daiki Ueno2020-05-3013-77/+80
|\ \ \ | |_|/ |/| | | | | | | | lib: improve external file loading See merge request gnutls/gnutls!1261
| * | build: write "FILE *fp" instead of "FILE *fd"tmp-fileioDaiki Ueno2020-05-304-38/+38
| | | | | | | | | | | | | | | | | | | | | This makes it clear that "fd" is not a file descriptor but a FILE pointer. Suggested by Tim Rühsen. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * | gnutls_load_file: document limitation regarding partial failureDaiki Ueno2020-05-301-0/+4
| | | | | | | | | | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * | cert-cred: clear private key data loaded from fileDaiki Ueno2020-05-302-6/+15
| | | | | | | | | | | | | | | | | | | | | This makes use of the RF_SENSITIVE flag newly added to read_file function when reading potentially senstive information from a file. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * | lib: avoid file descriptor leak when application forksDaiki Ueno2020-05-308-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes use of the "e" flag of fopen, provided by the Gnulib's fopen-gnu module. Reported by Remi Denis-Courmont in: https://gitlab.com/gnutls/gnutls/-/issues/985 and fix suggested by Tim Rühsen. Signed-off-by: Daiki Ueno <ueno@gnu.org>
| * | gnulib: update git submoduleDaiki Ueno2020-05-296-32/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings in the new fopen-gnu module and the RF_SENSITIVE flag for fread_file and read_file. This also adds the following changes to be consistent with the latest changes in Gnulib: - the callers of fread_file and read_file to be adjusted for the FLAGS argument - "attribute.h" needs to be used extensively Signed-off-by: Daiki Ueno <ueno@gnu.org>
* | | Merge branch 'ncrypt-uwp10' into 'master'Dmitry Baryshkov2020-05-271-142/+176
|\ \ \ | | | | | | | | | | | | | | | | win32: allow using ncrypt in UWP builds See merge request gnutls/gnutls!1256
| * | | win32: move the NCRYPT key import into a functionSteve Lhomme2020-05-271-142/+176
| | |/ | |/| | | | | | | | | | | | | No functional change. The has been simply moved. Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
* | | Merge branch 'static-ncrypt' into 'master'Dmitry Baryshkov2020-05-272-4/+6
|\ \ \ | | | | | | | | | | | | | | | | Allow statically linking ncrypt (win32) See merge request gnutls/gnutls!1254
| * | | configure.ac: determine if the Vista APIs can be linked staticallySteve Lhomme2020-05-272-4/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If _WIN32_WINNT is higher or equal to 0x0600, Vista API's are allowed during the build. We can assume that the minimum platform the code will run on is Vista [1] In that case there's no need to call API's (ncrypt) dynamically when it can be done statically. [1] https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
* | | Merge branch 'tmp-fips-redefinition' into 'master'Dmitry Baryshkov2020-05-273-14/+6
|\ \ \ | |/ / |/| | | | | | | | fips: make FIPS140-2 mode enablement logic simpler See merge request gnutls/gnutls!1253
| * | fips: remove FIPS_STARTUP_ONLY_TEST_CASE macrotmp-fips-redefinitionDaiki Ueno2020-05-201-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | The macro was intended to avoid non-recoverable errors during library initialization, but the code path has been removed in commit 3963518d067a64412bbe0aa9ce5fc33ae729c15f. Signed-off-by: Daiki Ueno <dueno@redhat.com>
| * | fips: make FIPS140-2 mode enablement logic simplerDaiki Ueno2020-05-202-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, to enable the FIPS140-2 mode, both /etc/system-fips and the fips=1 kernel command line need to be set. While this was designed to be consistent, the convention is not well followed by the other crypto libraries and the former tends to be ignored. This aligns the behavior to the latter, i.e. if fips=1 is set, the library enables the FIPS140-2 mode regardless of the existence of /etc/system-fips. Suggested by Alexander Sosedkin. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | | Merge branch 'crpyt32' into 'master'Dmitry Baryshkov2020-05-252-6/+2
|\ \ \ | |_|/ |/| | | | | | | | win32: link with crypt32 See merge request gnutls/gnutls!1257
| * | win32: link with crypt32Steve Lhomme2020-05-202-6/+2
| |/ | | | | | | | | | | | | | | | | | | | | Since 5d03564cccd2c10c41252ea468d4a098bd08e9c1 we use CertOpenStore(). To properly link it needs to be linked with the crypt32.dll. https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore This library was missing from the pkg-config library. It exists in thirdparty_libadd to link gnutls as a DLL. Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
* | Update session_ticket.c to add support for zero length session tickets ↵rrivers22020-05-241-8/+10
| | | | | | | | | | | | | | | | returned from the server check that ticket_len > 0 prior to calling gnutls_realloc_fast Signed-off-by: Rod Rivers <5981058-rrivers2@users.noreply.gitlab.com>
* | Merge branch 'tmp-vendor-minitasn1' into 'master'Dmitry Baryshkov2020-05-2416-8252/+6
|\ \ | | | | | | | | | | | | Vendor-in libtasn1 sources in a form of minitasn1 See merge request gnutls/gnutls!1247
| * | build: vendor in libtasn1 codetmp-vendor-minitasn1Dmitry Baryshkov2020-05-2416-8252/+6
| | | | | | | | | | | | | | | | | | | | | | | | Instead of keeping the minitasn1 source in Git, vendor in it during bootstrap as we do with Nettle code. This also upgrades included minitasn1 to latest version (4.16.0). Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | | Merge branch 'x509-common-name' into 'master'Dmitry Baryshkov2020-05-241-0/+16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | x509: support commonName extension Closes #989 See merge request gnutls/gnutls!1250
| * | | x509: support commonName extensionDmitry Baryshkov2020-05-181-0/+16
| | |/ | |/| | | | | | | | | | | | | | | | | | | Add support for Common Name certificate extension. Fixes #989 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | | x509: aki: always print authorityCert infoDmitry Baryshkov2020-05-171-3/+6
|/ / | | | | | | | | | | | | | | | | Always print authorityCertIssuer/SerialNumber. Currently it is output only if keyIdentifier is not present. Fixes #991 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | Merge branch 'cert-policies' into 'master'Dmitry Baryshkov2020-05-151-1/+27
|\ \ | | | | | | | | | | | | Decode certificate policies OIDs See merge request gnutls/gnutls!1245
| * | output: add Russian security class policiesDmitry Baryshkov2020-05-141-0/+8
| | | | | | | | | | | | | | | | | | | | | Add Russian Security Class certificate policies (per draft-deremin-rfc4491-bis). Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
| * | x509: print certificate policiy namesDmitry Baryshkov2020-05-141-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | Add ability to print names for several pre-defined Certificate policies. Currently the list is populated with anyPolicy from X.509 and CA/B policies. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | | Merge branch 'pkcs7-attrs' into 'master'Dmitry Baryshkov2020-05-145-45/+95
|\ \ \ | |/ / | | | | | | | | | PKCS7 attribute printing update See merge request gnutls/gnutls!1246
| * | pkcs7: add function to display signature informationDmitry Baryshkov2020-05-143-0/+36
| | | | | | | | | | | | | | | | | | | | | Basically export print_pkcs7_info() in a way usable by external applications. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
| * | pkcs7: decode attribute OIDs when printingDmitry Baryshkov2020-05-141-2/+32
| | | | | | | | | | | | | | | | | | | | | Try printing symbolic names for well-known OIDs when printing PKCS7 signature info. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
| * | x509: generify oid to str conversionsDmitry Baryshkov2020-05-142-43/+27
| |/ | | | | | | | | | | | | Make oid to name conversion functions generic enough by allowing caller to specify a pointer to OID table. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | Merge branch 'tmp-fips-leftover' into 'master'Daiki Ueno2020-05-141-4/+33
|\ \ | |/ |/| | | | | fips: leftover fixes See merge request gnutls/gnutls!1243
| * nettle: disable RSA blinding in FIPS selfteststmp-fips-leftoverDaiki Ueno2020-05-051-4/+33
| | | | | | | | | | | | | | | | Nettle's RSA signing, encryption and decryption functions still require randomness for blinding, so fallback to use a fixed buffer in selftests where entropy might not be available. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | accelerated: use AES-NI for AES-XTS when availableAnderson Toshiyuki Sasaki2020-05-074-1/+186
|/ | | | | | | This introduces a wrapper for the CRYPTOGAMS AES-XTS implementation already present in the generated assembly code. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
* nettle: expose SIV-CMAC through the AEAD interfaceDaiki Ueno2020-05-044-7/+211
| | | | | | | | | This adds a couple of new cipher algorithms GNUTLS_CIPHER_AES_128_SIV and GNUTLS_CIPHER_AES_256_SIV, exposing nettle_siv_cmac_aes{128,256}* functions. Note that they can only used with the AEAD interface and authentication tags are prepended (not appended) to the ciphertext. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* nettle: vendor in SIV-CMAC implementationDaiki Ueno2020-05-041-0/+6
| | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
* nettle: avoid manual backports of CFB8, CMAC, and XTSDaiki Ueno2020-05-049-979/+85
| | | | Signed-off-by: Daiki Ueno <ueno@gnu.org>
* nettle: rename import-chacha-from-nettle.sh to import-from-nettle.shDaiki Ueno2020-05-042-8/+8
| | | | | | This script will handle other backports except ECC as well. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* Merge branch 'tmp-reproducible-sig-doc' into 'master'Daiki Ueno2020-05-041-3/+6
|\ | | | | | | | | | | | | doc: expand GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE description on RSA-PSS [ci skip] Closes #953 See merge request gnutls/gnutls!1242
| * doc: expand GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE description on RSA-PSS [ci skip]tmp-reproducible-sig-docDaiki Ueno2020-04-301-3/+6
| | | | | | | | | | | | | | | | For RSA-PSS, this flag alone doens't fully enable reproducible signatures and the user needs to indicate the fact that a zero-length salt is used through SPKI upon verification. Signed-off-by: Daiki Ueno <ueno@gnu.org>
* | gost: use gostdsa-vko from nettle 3.6rc3Dmitry Baryshkov2020-04-283-112/+2
| | | | | | | | | | | | | | Now as we have upgraded Nettle to 3.6rc3 (which includes gostdsa_vko), use this function from imported nettle sources. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* | nettle: update imported source to nettle 3.6rc3Dmitry Baryshkov2020-04-281-1/+2
|/ | | | | | | | Update imported nettle version to 3.6rc3. This will bring in updated gmp-glue code and a possiblity to use gostdsa-vko imported from nettle sources. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* Merge branch 'tmp-ext-name' into 'master'Daiki Ueno2020-04-244-0/+35
|\ | | | | | | | | gnutls_session_ext_register: keep track of extension name See merge request gnutls/gnutls!1224
| * gnutls_session_ext_register: keep track of extension nametmp-ext-nameDaiki Ueno2020-04-212-0/+3
| | | | | | | | | | | | | | | | | | | | | | Previously it discarded the name argument, and that was making the debug output awkward, e.g., running tests/tls-session-ext-register -v: client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/242) for 'client hello' client|<4>| EXT[0x9cdc20]: Preparing extension ((null)/241) for 'client hello' client|<4>| EXT[0x9cdc20]: Sending extension (null)/241 (2 bytes) Signed-off-by: Daiki Ueno <dueno@redhat.com>