diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-18 23:39:39 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-18 23:39:39 +0000 |
commit | 091afae7615c15425e2f35b73378bb127d067db6 (patch) | |
tree | a0031c6135d0493bfacd7409691f434fe37af9d4 | |
parent | f9060dedd7433f672fd10398dc325c2be151f8fc (diff) |
Minor fixes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3807 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | res/res_crypto.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index 6152d42b0..912d7c8c0 100755 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -3,9 +3,9 @@ * * Provide Cryptographic Signature capability * - * Copyright (C) 1999, Mark Spencer + * Copyright (C) 1999-2004, Digium, Inc. * - * Mark Spencer <markster@linux-support.net> + * Mark Spencer <markster@digium.com> * * This program is free software, distributed under the terms of * the GNU General Public License @@ -370,12 +370,14 @@ extern int ast_encrypt_bin(unsigned char *dst, const unsigned char *src, int src bytes = srclen; if (bytes > 128 - 41) bytes = 128 - 41; - /* Process chunks 128 bytes at a time */ - res = RSA_private_encrypt(bytes, src, dst, key->rsa, RSA_PKCS1_OAEP_PADDING); - if (res != 128) + /* Process chunks 128-41 bytes at a time */ + res = RSA_public_encrypt(bytes, src, dst, key->rsa, RSA_PKCS1_OAEP_PADDING); + if (res != 128) { + ast_log(LOG_NOTICE, "How odd, encrypted size is %d\n", res); return -1; - src += 128 - 41; - srclen -= 128 - 41; + } + src += bytes; + srclen -= bytes; pos += res; dst += res; } |