]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - openssl.c
mixer: sleep: Change to fade-in mood later.
[paraslash.git] / openssl.c
index 99b3f7a6c3258bc5ef9981f062388a5a7d2854ba..7d5bb25d53cf73009803fe0e62ca15d0167a05cb 100644 (file)
--- 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 */