diff options
Diffstat (limited to 'crypto/x509/x509_cmp.c')
-rw-r--r-- | crypto/x509/x509_cmp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index cd20b6d66f..dbbe0a9236 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -295,6 +295,22 @@ int X509_check_private_key(X509 *x, EVP_PKEY *k) } break; #endif +#ifndef OPENSSL_NO_ECDSA + case EVP_PKEY_ECDSA: + { + int r = EC_POINT_cmp(xk->pkey.ecdsa->group,xk->pkey.ecdsa->pub_key,k->pkey.ecdsa->pub_key,NULL); + if (r != 0) + { + if (r == 1) + X509err(X509_F_X509_CHECK_PRIVATE_KEY, X509_R_KEY_VALUES_MISMATCH); + else + X509err(X509_F_X509_CHECK_PRIVATE_KEY, ERR_R_EC_LIB); + + goto err; + } + } + break; +#endif #ifndef OPENSSL_NO_DH case EVP_PKEY_DH: /* No idea */ |