mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Minor fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3,9 +3,9 @@
|
|||||||
*
|
*
|
||||||
* Provide Cryptographic Signature capability
|
* 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
|
* This program is free software, distributed under the terms of
|
||||||
* the GNU General Public License
|
* 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;
|
bytes = srclen;
|
||||||
if (bytes > 128 - 41)
|
if (bytes > 128 - 41)
|
||||||
bytes = 128 - 41;
|
bytes = 128 - 41;
|
||||||
/* Process chunks 128 bytes at a time */
|
/* Process chunks 128-41 bytes at a time */
|
||||||
res = RSA_private_encrypt(bytes, src, dst, key->rsa, RSA_PKCS1_OAEP_PADDING);
|
res = RSA_public_encrypt(bytes, src, dst, key->rsa, RSA_PKCS1_OAEP_PADDING);
|
||||||
if (res != 128)
|
if (res != 128) {
|
||||||
|
ast_log(LOG_NOTICE, "How odd, encrypted size is %d\n", res);
|
||||||
return -1;
|
return -1;
|
||||||
src += 128 - 41;
|
}
|
||||||
srclen -= 128 - 41;
|
src += bytes;
|
||||||
|
srclen -= bytes;
|
||||||
pos += res;
|
pos += res;
|
||||||
dst += res;
|
dst += res;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user