[Asterisk-cvs] asterisk/res res_crypto.c,1.15,1.16
markster at lists.digium.com
markster at lists.digium.com
Sat Sep 18 19:35:42 CDT 2004
Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv15590/res
Modified Files:
res_crypto.c
Log Message:
Minor fixes
Index: res_crypto.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_crypto.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- res_crypto.c 18 Sep 2004 03:59:51 -0000 1.15
+++ res_crypto.c 18 Sep 2004 23:39:39 -0000 1.16
@@ -3,9 +3,9 @@
*
* Provide Cryptographic Signature capability
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -370,12 +370,14 @@
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;
}
More information about the svn-commits
mailing list