X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt.c;h=c2b50a7edca96f53fb1ccc3fd23ee9b9ffd9508f;hp=653b1a2452cdc85215d916c1abd35f641800dcf1;hb=f269333700038603703ec79c909d514bee731faf;hpb=8e1e5cc794c84fcfee75f701b339ae85a02eb1b8 diff --git a/crypt.c b/crypt.c index 653b1a24..c2b50a7e 100644 --- a/crypt.c +++ b/crypt.c @@ -46,7 +46,8 @@ static EVP_PKEY *load_key(const char *file, int private) return pkey; } -static int get_key(char *key_file, RSA **rsa, int private) + +int get_rsa_key(char *key_file, RSA **rsa, int private) { EVP_PKEY *key = load_key(key_file, private); @@ -77,7 +78,7 @@ int para_decrypt_buffer(char *key_file, unsigned char *outbuf, unsigned char *in int rsa_inlen) { RSA *rsa; - int ret = get_key(key_file, &rsa, LOAD_PRIVATE_KEY); + int ret = get_rsa_key(key_file, &rsa, LOAD_PRIVATE_KEY); if (ret < 0) return ret; @@ -128,7 +129,7 @@ int para_encrypt_buffer(char *key_file, unsigned char *inbuf, const unsigned len, unsigned char *outbuf) { RSA *rsa; - int ret = get_key(key_file, &rsa, LOAD_PUBLIC_KEY); + int ret = get_rsa_key(key_file, &rsa, LOAD_PUBLIC_KEY); if (ret < 0) return ret;