projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
preparations for user list in memory
[paraslash.git]
/
crypt.c
diff --git
a/crypt.c
b/crypt.c
index 653b1a2452cdc85215d916c1abd35f641800dcf1..c2b50a7edca96f53fb1ccc3fd23ee9b9ffd9508f 100644
(file)
--- a/
crypt.c
+++ b/
crypt.c
@@
-46,7
+46,8
@@
static EVP_PKEY *load_key(const char *file, int private)
return pkey;
}
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);
{
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 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;
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;
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;
if (ret < 0)
return ret;