X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=openssl.c;h=7d5bb25d53cf73009803fe0e62ca15d0167a05cb;hb=7e611b37e41f0ec7ec6d3173b7e88ed5b9b3a276;hp=99b3f7a6c3258bc5ef9981f062388a5a7d2854ba;hpb=5f20d9afde364f9ce51aa7841ebe513028a65e81;p=paraslash.git diff --git a/openssl.c b/openssl.c index 99b3f7a6..7d5bb25d 100644 --- a/openssl.c +++ b/openssl.c @@ -55,6 +55,11 @@ void crypt_init(void) srandom(seed); } +void crypt_shutdown(void) +{ + CRYPTO_cleanup_all_ex_data(); +} + static int get_private_key(const char *path, RSA **rsa) { EVP_PKEY *pkey; @@ -137,7 +142,7 @@ fail: return ret; } -int get_public_key(const char *key_file, struct asymmetric_key **result) +int apc_get_pubkey(const char *key_file, struct asymmetric_key **result) { unsigned char *blob; size_t decoded_size; @@ -164,7 +169,7 @@ out: return ret; } -void free_public_key(struct asymmetric_key *key) +void apc_free_pubkey(struct asymmetric_key *key) { if (!key) return; @@ -172,7 +177,7 @@ void free_public_key(struct asymmetric_key *key) free(key); } -int priv_decrypt(const char *key_file, unsigned char *outbuf, +int apc_priv_decrypt(const char *key_file, unsigned char *outbuf, unsigned char *inbuf, int inlen) { struct asymmetric_key *priv; @@ -207,7 +212,7 @@ out: return ret; } -int pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, +int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, unsigned len, unsigned char *outbuf) { int ret, flen = len; /* RSA_public_encrypt expects a signed int */