summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* _gnutls_PRF: was made inline functionNikos Mavrogiannopoulos2017-06-012-32/+22
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added low-level unit tests on TLS 1.0 and 1.2 PRFsNikos Mavrogiannopoulos2017-06-014-2/+245
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* prf: implement the TLS 1.0 and 1.2 PRFs using nettleNikos Mavrogiannopoulos2017-06-016-216/+336
| | | | | | | That simplifies the existing PRF code and moves it in the crypto-backend component. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc: refer to the site for commercial support optionsNikos Mavrogiannopoulos2017-05-311-31/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: mini-record-retvals: include AES-CBC testsNikos Mavrogiannopoulos2017-05-311-0/+1
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: eliminated build warningsNikos Mavrogiannopoulos2017-05-315-11/+8
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: combined tables of sign-verify teststmp-rsa-pss-round-twoNikos Mavrogiannopoulos2017-05-317-175/+89
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Only accept known public key algorithms in the GNUTLS_PRIVKEY_EXT private keysNikos Mavrogiannopoulos2017-05-311-0/+8
| | | | | | | The reason is that this API, assumes very low level primitives which are not available for the newer RSA-PSS private keys. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* _gnutls_privkey_*_sign_params: added support for GNUTLS_PRIVKEY_EXT keysNikos Mavrogiannopoulos2017-05-311-0/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* tests: added basic test on "external" keys with gnutls_privkey_import_ext2()Nikos Mavrogiannopoulos2017-05-312-1/+289
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
* gnutls_x509_privkey_sign_data: wrap over gnutls_privkey_sign_data()Nikos Mavrogiannopoulos2017-05-311-86/+28
| | | | | | That will allow this function to operate with the new key types. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added unit tests for the gnutls_x509_* sign/verify APIsNikos Mavrogiannopoulos2017-05-314-154/+345
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added tests signature validation using the sign/verify_data APIsNikos Mavrogiannopoulos2017-05-312-1/+201
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Separated use of GNUTLS_PRIVKEY_FLAG_PROVABLE and ↵Nikos Mavrogiannopoulos2017-05-313-4/+4
| | | | | | | | GNUTLS_PRIVKEY_SIGN_FLAG_REPRODUCIBLE For simplicity, rename GNUTLS_PRIVKEY_SIGN_FLAG_REPRODUCIBLE to GNUTLS_PRIVKEY_FLAG_REPRODUCIBLE. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* _gnutls_privkey_find_sign_params: renamed and simplifiedNikos Mavrogiannopoulos2017-05-317-72/+53
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_privkey_sign_hash: removed duplicate codeNikos Mavrogiannopoulos2017-05-311-15/+1
| | | | | | The same code was available in _gnutls_privkey_find_sign_params(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* GNUTLS_E_INSUFFICIENT_SECURITY: moved to fatal errorsNikos Mavrogiannopoulos2017-05-311-2/+3
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tls-sig: re-organize and simplify the TLS signature generation and verificationNikos Mavrogiannopoulos2017-05-315-237/+310
| | | | | | | | That makes sure that the high level APIs are used when possible, and separate the TLS 1.2 from other code paths. This will allow supporting signature schemes like EdDSA and others. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: modify tests to allow signatures with SHA1Nikos Mavrogiannopoulos2017-05-317-22/+29
| | | | | | | There were several tests that were utilizing SHA1 signatures but were not failing due to the bug in gnutls_pubkey_verify_hash2(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_pubkey_verify_hash2: do not allow GNUTLS_VERIFY_USE_TLS1_RSA with ↵Nikos Mavrogiannopoulos2017-05-311-0/+2
| | | | | | non-RSA keys Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_pubkey_verify_hash2: check for broken signature algorithmsNikos Mavrogiannopoulos2017-05-311-2/+16
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_pubkey_verify_data2: do not utilize GNUTLS_VERIFY_USE_RSA_PSSNikos Mavrogiannopoulos2017-05-313-6/+12
| | | | | | | This flag is not required for verification since the signature algorithm is sufficient to detect RSA-PSS without requiring any flags. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: do not utilize GNUTLS_VERIFY_USE_RSA_PSSNikos Mavrogiannopoulos2017-05-311-23/+21
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* certtool: do not ask for password when exporting to PKCS#8 implicitlytmp-rsa-pss-additionNikos Mavrogiannopoulos2017-05-291-1/+6
| | | | | | | | | Previously --generate-privkey wouldn't ask for password unless --pkcs8 was explicitly given. Keep that behavior, and do not ask for any password even if we need to export to PKCS#8 for some key types. Always require the --pkcs8 option to encrypt with password. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* updated auto-generated filesNikos Mavrogiannopoulos2017-05-295-168/+289
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc: mention RSA-PSS-SHA* signature algorithmsNikos Mavrogiannopoulos2017-05-291-1/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* certtool: replaced rsa-pss-sign with sign-params optionNikos Mavrogiannopoulos2017-05-293-9/+23
| | | | | | | This option could accomodate future enhancements/additions in certificate signining. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* certtool: better documentation on rsa-pss-signNikos Mavrogiannopoulos2017-05-291-1/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* replaced MAX_SIGNATURE_ALGORITHMS macro with MAX_ALGOSNikos Mavrogiannopoulos2017-05-292-4/+3
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added unit test for gnutls_sign_supports_pk_algorithm()Nikos Mavrogiannopoulos2017-05-292-1/+69
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tls-fuzzer: ignore the incomplete RSA-PSS testsNikos Mavrogiannopoulos2017-05-291-1/+4
| | | | | | | These tests fail because tls-fuzzer currently does not properly implement RSA-PSS. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: verify that generated RSA-PSS keys can be read with certtool -kNikos Mavrogiannopoulos2017-05-291-0/+7
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* certtool: use PKCS#8 format for generated RSA-PSS keysNikos Mavrogiannopoulos2017-05-291-0/+5
| | | | | | | | An RSA-PSS key has additional parameters which cannot be stored in the "standard" PKCS#1 format. For that when asked to generate an RSA-PSS key, we export to the PKCS#8 form. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* doc updateNikos Mavrogiannopoulos2017-05-291-1/+4
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: x509sign-verify: include ECDSA and RSA-PSS key testsNikos Mavrogiannopoulos2017-05-291-133/+119
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tlsfuzzer: the test-certificate-verify-malformed check now passesNikos Mavrogiannopoulos2017-05-291-3/+1
| | | | | | | | Previously it was expecting a different alert code than gnutls returned. Now gnutls returns the expected alert code (GNUTLS_A_DECRYPT_ERROR) on malformed signatures. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* alert: map GNUTLS_E_PK_SIG_VERIFY_FAILED to GNUTLS_A_DECRYPT_ERRORNikos Mavrogiannopoulos2017-05-291-1/+4
| | | | | | | This makes server respond with GNUTLS_A_DECRYPT_ERROR on malformed signatures, which is the expected behavior. Hinted by Hubert Kario. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Increased the maximum number of signature algorithmsNikos Mavrogiannopoulos2017-05-291-1/+1
| | | | | | That allows including all the existing signatures including DSA. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* x509sign-verify: corrected test to perform RSA tests on RSA keysNikos Mavrogiannopoulos2017-05-291-17/+21
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added tests for RSA-PSS key exchange under TLS 1.2Nikos Mavrogiannopoulos2017-05-299-132/+289
| | | | | | That includes tests with RSA and RSA-PSS server and client certificates. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* publickey: map RSA ciphersuites to GNUTLS_PK_RSA_PSSNikos Mavrogiannopoulos2017-05-291-0/+2
| | | | | | That is in addition to GNUTLS_PK_RSA Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Rework KX -> PK mappingsDmitry Eremin-Solenikov2017-05-296-55/+35
| | | | | | | | GOST VKO and PSS keys would support several public keys, so change the previous 1:1 kx->pk mapping into 1:many. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tests: added TLS 1.2 tests with RSA-PSS signatures on RSA certificatesNikos Mavrogiannopoulos2017-05-291-0/+2
| | | | Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_privkey_sign_hash: use the GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS flagNikos Mavrogiannopoulos2017-05-292-5/+21
| | | | | | | | That is, the privkey_sign_hash() function was made static (no users other than the same file), and gnutls_privkey_sign_hash will take into account the GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS, if specified. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* tls-sig: sign with RSA-PSS when requested by negotiated signature algorithmNikos Mavrogiannopoulos2017-05-291-7/+25
| | | | | | | | | | That is, when signing a TLS message, take into account the negotiated signature algorithm, in addition to the hash algorithm to decide which flags to pass to gnutls_privkey_sign_hash(). This allows signing the handshake messages with RSA-PSS even when an RSA key is present. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* priority: enabled RSA-PSS signatures by defaultNikos Mavrogiannopoulos2017-05-291-0/+14
| | | | | | | | | They are prioritized low on the list to reduce compatibility issues in case they are wrongly implemented in gnutls or in the peer implementation. To be revised when more elaborate compatibility tests are made. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* ext/signature: accept compatible algorithms with PKNikos Mavrogiannopoulos2017-05-291-2/+1
| | | | | | | | | | That is instead of using a 1-1 mapping of signature algorithms to public key algorithms, use gnutls_sign_supports_pk_algorithm() to determine whether algorithms match. That way we can allow GNUTLS_SIGN_RSA_PSS_SHA256 under GNUTLS_PK_RSA and GNUTLS_PK_RSA_PSS keys. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* gnutls_pubkey_verify_hash2: corrected operation with RSA-PSS keysNikos Mavrogiannopoulos2017-05-293-33/+42
| | | | | | | | | | | | | That is, do not check the flag GNUTLS_VERIFY_USE_RSA_PSS, as we already have enough information to determine whether an RSA-PSS signature is used (the sign algorithm). Also return the code GNUTLS_E_INCOMPATIBLE_SIG_WITH_KEY when a signature algorithm incompatible with the public key is encountered. In addition, fixed few misplacements of GNUTLS_PK_RSA_PSS in switch cases. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* Introduced gnutls_sign_supports_pk_algorithm()Nikos Mavrogiannopoulos2017-05-293-10/+49
| | | | | | | | | This function allows to test whether a combination of public key algorithm and signature algorithm are supported. This is introduced for RSA-PSS signatures which can be generated by a GNUTLS_PK_RSA key or by a GNUTLS_PK_RSA_PSS key. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
* x509: implement RSA-PSS signature schemeDaiki Ueno2017-05-2950-189/+2449
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables RSA-PSS signature scheme in the X.509 functions and certtool. When creating RSA-PSS signature, there are 3 different scenarios: a. both a private key and a certificate are RSA-PSS b. the private key is RSA, while the certificate is RSA-PSS c. both the private key and the certificate are RSA For (a) and (b), the RSA-PSS parameters are read from the certificate. Any conflicts in parameters between the private key and the certificate are reported as an error. For (c), the sign functions, such as gnutls_x509_crt_privkey_sign() or gnutls_privkey_sign_data(), shall be instructed to generate an RSA-PSS signature. This can be done with the new flag GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS. Verification is similar to signing, except for the case (c), use the flag GNUTLS_VERIFY_USE_RSA_PSS instead of GNUTLS_PRIVKEY_SIGN_FLAG_RSA_PSS. From the command line, certtool has a couple of new options: --rsa-pss and --rsa-pss-sign. The --rsa-pss option indicates that the generated private key or certificate is restricted to RSA-PSS, while the --rsa-pss-sign option indicates that the generated certificate is signed with RSA-PSS. For simplicity, there is no means of choosing arbitrary salt length. When it is not given by a private key or a certificate, it is automatically calculated from the underlying hash algorithm and the RSA modulus bits. [minor naming changes by nmav] Signed-off-by: Daiki Ueno <dueno@redhat.com> Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>