summaryrefslogtreecommitdiffstats
path: root/ssl/t1_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2015-12-30 13:34:53 +0000
committerDr. Stephen Henson <steve@openssl.org>2015-12-30 13:34:53 +0000
commit72245f340c41c7d04b7a2b7a99aec9897e22d9cb (patch)
tree5063291084666d4cc180c5b4086e1cc65e0748ea /ssl/t1_lib.c
parent923ffa97d1278a155d2ec7783c997fb7e2c5e28b (diff)
Check for missing DSA parameters.
If DSA parameters are absent return -1 (for unknown) in DSA_security_bits. If parameters are absent when a certificate is set in an SSL/SSL_CTX structure this will reject the certificate by default. This will cause DSA certificates which omit parameters to be rejected but that is never (?) done in practice. Thanks to Brian 'geeknik' Carpenter for reporting this issue. Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'ssl/t1_lib.c')
-rw-r--r--ssl/t1_lib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 73ad6048d3..421a5a6f93 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -4253,13 +4253,18 @@ DH *ssl_get_auto_dh(SSL *s)
static int ssl_security_cert_key(SSL *s, SSL_CTX *ctx, X509 *x, int op)
{
- int secbits;
+ int secbits = -1;
EVP_PKEY *pkey = X509_get_pubkey(x);
if (pkey) {
+ /*
+ * If no parameters this will return -1 and fail using the default
+ * security callback for any non-zero security level. This will
+ * reject keys which omit parameters but this only affects DSA and
+ * omission of parameters is never (?) done in practice.
+ */
secbits = EVP_PKEY_security_bits(pkey);
EVP_PKEY_free(pkey);
- } else
- secbits = -1;
+ }
if (s)
return ssl_security(s, op, secbits, 0, x);
else