diff options
author | Adam Langley <agl@google.com> | 2016-07-12 20:39:20 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-07-12 20:55:41 +0300 |
commit | 310d3f63f38cf8a82fa9ae5032e343ba5159eb4d (patch) | |
tree | 18b60b1a10d16a7771c2c7f36bc991d65fa5d307 /crypto/x509 | |
parent | 27516f7c9762c2b21ff4add87aa5b7ac41237575 (diff) |
Change |EVP_PKEY_up_ref| to return int.
Upstream have added |EVP_PKEY_up_ref|, but their version returns an int.
Having this function with a different signature like that is dangerous
so this change aligns BoringSSL with upstream. Users of this function in
Chromium and internally should already have been updated.
Change-Id: I0a7aeaf1a1ca3b0f0c635e2ee3826aa100b18157
Reviewed-on: https://boringssl-review.googlesource.com/8736
Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x_pubkey.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c index 23534b2b..3d07d661 100644 --- a/crypto/x509/x_pubkey.c +++ b/crypto/x509/x_pubkey.c @@ -141,7 +141,8 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) CRYPTO_STATIC_MUTEX_lock_read(&g_pubkey_lock); if (key->pkey != NULL) { CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); - return EVP_PKEY_up_ref(key->pkey); + EVP_PKEY_up_ref(key->pkey); + return key->pkey; } CRYPTO_STATIC_MUTEX_unlock_read(&g_pubkey_lock); @@ -170,7 +171,8 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) } OPENSSL_free(spki); - return EVP_PKEY_up_ref(ret); + EVP_PKEY_up_ref(ret); + return ret; error: OPENSSL_free(spki); |