diff options
author | Geoff Thorpe <geoff@openssl.org> | 2001-08-25 17:28:23 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2001-08-25 17:28:23 +0000 |
commit | 78435364ec450408b63acef65494dbe16a97792a (patch) | |
tree | c54c94a381a26b4cb3d0cbfe324c874dfbe7c92e /crypto/evp/p_lib.c | |
parent | 5cbc2e8bc187058e2ec2f17f53c3429c16dbc0d8 (diff) |
Changes crypto/evp/ and ssl/ code from directly incrementing reference
counts in DH, DSA, and RSA structures. Instead they use the new "***_up()"
functions that handle this.
Diffstat (limited to 'crypto/evp/p_lib.c')
-rw-r--r-- | crypto/evp/p_lib.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 1fd0d19aee..86178f1db3 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -210,7 +210,8 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) { int ret = EVP_PKEY_assign_RSA(pkey, key); - if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_RSA); + if(ret) + RSA_up(key); return ret; } @@ -220,7 +221,7 @@ RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) EVPerr(EVP_F_EVP_PKEY_GET1_RSA, EVP_R_EXPECTING_AN_RSA_KEY); return NULL; } - CRYPTO_add(&pkey->pkey.rsa->references, 1, CRYPTO_LOCK_RSA); + RSA_up(pkey->pkey.rsa); return pkey->pkey.rsa; } #endif @@ -229,7 +230,8 @@ RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) { int ret = EVP_PKEY_assign_DSA(pkey, key); - if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DSA); + if(ret) + DSA_up(key); return ret; } @@ -239,7 +241,7 @@ DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) EVPerr(EVP_F_EVP_PKEY_GET1_DSA, EVP_R_EXPECTING_A_DSA_KEY); return NULL; } - CRYPTO_add(&pkey->pkey.dsa->references, 1, CRYPTO_LOCK_DSA); + DSA_up(pkey->pkey.dsa); return pkey->pkey.dsa; } #endif @@ -249,7 +251,8 @@ DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) { int ret = EVP_PKEY_assign_DH(pkey, key); - if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DH); + if(ret) + DH_up(key); return ret; } @@ -259,7 +262,7 @@ DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey) EVPerr(EVP_F_EVP_PKEY_GET1_DH, EVP_R_EXPECTING_A_DH_KEY); return NULL; } - CRYPTO_add(&pkey->pkey.dh->references, 1, CRYPTO_LOCK_DH); + DH_up(pkey->pkey.dh); return pkey->pkey.dh; } #endif |