summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-11-06 18:00:07 +0000
committerNick Mathewson <nickm@torproject.org>2007-11-06 18:00:07 +0000
commite047f7f8652d9c67ed96d4ff6f02fa7e23333c54 (patch)
tree1108bb0903409319cd8d49057b6f9c31d7bb7a95 /src/common/crypto.c
parentaf60d79f5deee3e6b264049dfa8512f381a8cbc6 (diff)
downloadtor-e047f7f8652d9c67ed96d4ff6f02fa7e23333c54.tar.gz
tor-e047f7f8652d9c67ed96d4ff6f02fa7e23333c54.zip
r16455@catbus: nickm | 2007-11-06 12:48:00 -0500
Parse CERT cells and act correctly when we get them. svn:r12396
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 4289f48395..c4a06c7c11 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -246,6 +246,17 @@ _crypto_new_pk_env_rsa(RSA *rsa)
return env;
}
+/** used by tortls.c: wrap the RSA from an evp_pkey in a crypto_pk_env_t.
+ * returns NULL if this isn't an RSA key. */
+crypto_pk_env_t *
+_crypto_new_pk_env_evp_pkey(EVP_PKEY *pkey)
+{
+ RSA *rsa;
+ if (!(rsa = EVP_PKEY_get1_RSA(pkey)))
+ return NULL;
+ return _crypto_new_pk_env_rsa(rsa);
+}
+
/** used by tortls.c: get an equivalent EVP_PKEY* for a crypto_pk_env_t. Iff
* private is set, include the private-key portion of the key. */
EVP_PKEY *