diff options
author | David Benjamin <davidben@chromium.org> | 2014-12-04 16:26:47 -0500 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-12-05 17:27:23 +0000 |
commit | 8278184631424eaf0365d54fb81fd228af2dce38 (patch) | |
tree | af42e9a87e1bdfcd5a33c783b81530693dec93e3 | |
parent | 83abdd6e58eebba120aa80e8e855b65dfe776d95 (diff) | |
download | boringssl-8278184631424eaf0365d54fb81fd228af2dce38.zip boringssl-8278184631424eaf0365d54fb81fd228af2dce38.tar.gz boringssl-8278184631424eaf0365d54fb81fd228af2dce38.tar.bz2 |
Remove redundant checks in ssl_cert_dup.
PR#3613
(Imported from upstream's fc3968a25ce0c16cab8730ec0d68a59856158029)
We don't care about GOST, but removing redundant code is reasonable. Also
switch that CRYPTO_add to EVP_PKEY_dup. Missed a spot.
Change-Id: I768ec546d987fb3d8bc3decf7ebf1a5590fbb6c2
Reviewed-on: https://boringssl-review.googlesource.com/2477
Reviewed-by: Adam Langley <agl@google.com>
-rw-r--r-- | ssl/ssl_cert.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 771ec67..f083920 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -247,29 +247,7 @@ CERT *ssl_cert_dup(CERT *cert) if (cpk->privatekey != NULL) { - rpk->privatekey = cpk->privatekey; - CRYPTO_add(&cpk->privatekey->references, 1, - CRYPTO_LOCK_EVP_PKEY); - - switch(i) - { - /* If there was anything special to do for - * certain types of keys, we'd do it here. - * (Nothing at the moment, I think.) */ - - case SSL_PKEY_RSA_ENC: - case SSL_PKEY_RSA_SIGN: - /* We have an RSA key. */ - break; - - case SSL_PKEY_ECC: - /* We have an ECC key */ - break; - - default: - /* Can't happen. */ - OPENSSL_PUT_ERROR(SSL, ssl_cert_dup, SSL_R_LIBRARY_BUG); - } + rpk->privatekey = EVP_PKEY_dup(cpk->privatekey); } if (cpk->chain) |