From: Pekka Riikonen Date: Tue, 20 Feb 2001 20:23:47 +0000 (+0000) Subject: update X-Git-Tag: SILC.0.1~195 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=fa48a94c1d8c27976c4c6158c20785f0a041fa1e;p=silc.git update --- diff --git a/lib/silccrypt/pkcs1.c b/lib/silccrypt/pkcs1.c index 8420b8b1..146e6618 100644 --- a/lib/silccrypt/pkcs1.c +++ b/lib/silccrypt/pkcs1.c @@ -33,9 +33,9 @@ ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-1.asc, and RFC 2437. - Copyright notice: All code, including the SILC PKCS API code that is - not part of the Mozilla code, falls under the same license (MPL or GPL) - found attached to this file, below. + Copyright notice: All code in this file, including the SILC PKCS API + code that is not part of the Mozilla code, falls under the same license + (MPL or GPL) found attached to this file, below. */ /* @@ -110,6 +110,7 @@ RSA_FormatOneBlock(unsigned int modulusLen, RSA_BlockType blockType, unsigned char *block; unsigned char *bp; int padLen; + int i; block = (unsigned char *) silc_malloc(modulusLen); if (block == NULL) @@ -152,15 +153,6 @@ RSA_FormatOneBlock(unsigned int modulusLen, RSA_BlockType blockType, * Blocks intended for public-key operation. */ case RSA_BlockPublic: - - /* XXX For now we can't do this because we can't get the - SilcRNG object down to this level. */ - silc_free(block); - return NULL; - -#if 0 - int i; - /* * 0x00 || BT || Pad || 0x00 || ActualData * 1 1 padLen 1 data_len @@ -171,14 +163,12 @@ RSA_FormatOneBlock(unsigned int modulusLen, RSA_BlockType blockType, for (i = 0; i < padLen; i++) { /* Pad with non-zero random data. */ do { - RNG_GenerateGlobalRandomBytes(bp + i, 1); + silc_rng_global_get_byte(bp + i); } while (bp[i] == RSA_BLOCK_AFTER_PAD_OCTET); } bp += padLen; *bp++ = RSA_BLOCK_AFTER_PAD_OCTET; memcpy(bp, data, data_len); -#endif - break; default: