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;
}
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
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;
}
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
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;
}
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
#ifndef OPENSSL_NO_RSA
if (cert->rsa_tmp != NULL)
{
+ RSA_up(cert->rsa_tmp);
ret->rsa_tmp = cert->rsa_tmp;
- CRYPTO_add(&ret->rsa_tmp->references, 1, CRYPTO_LOCK_RSA);
}
ret->rsa_tmp_cb = cert->rsa_tmp_cb;
#endif
return(0);
}
- CRYPTO_add(&rsa->references,1,CRYPTO_LOCK_RSA);
+ RSA_up(rsa);
EVP_PKEY_assign_RSA(pkey,rsa);
ret=ssl_set_pkey(ssl->cert,pkey);
return(0);
}
- CRYPTO_add(&rsa->references,1,CRYPTO_LOCK_RSA);
+ RSA_up(rsa);
EVP_PKEY_assign_RSA(pkey,rsa);
ret=ssl_set_pkey(ctx->cert, pkey);