Merge flagday into main branch.

svn:r1683
This commit is contained in:
Nick Mathewson
2004-04-24 22:17:50 +00:00
parent 83081f5ad6
commit c44016e86e
14 changed files with 311 additions and 199 deletions
+8 -3
View File
@@ -127,13 +127,18 @@ RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env)
}
/* used by tortls.c */
EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env)
EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env, int private)
{
RSA *key = NULL;
EVP_PKEY *pkey = NULL;
assert(env->key);
if (!(key = RSAPrivateKey_dup(env->key)))
goto error;
if (private) {
if (!(key = RSAPrivateKey_dup(env->key)))
goto error;
} else {
if (!(key = RSAPublicKey_dup(env->key)))
goto error;
}
if (!(pkey = EVP_PKEY_new()))
goto error;
if (!(EVP_PKEY_assign_RSA(pkey, key)))