aboutsummaryrefslogtreecommitdiff
path: root/networking/tls_rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/tls_rsa.c')
-rw-r--r--networking/tls_rsa.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/networking/tls_rsa.c b/networking/tls_rsa.c
index df711865c..60c54248e 100644
--- a/networking/tls_rsa.c
+++ b/networking/tls_rsa.c
@@ -8,12 +8,12 @@
8/* The code below is taken from parts of 8/* The code below is taken from parts of
9 * matrixssl-3-7-2b-open/crypto/pubkey/pkcs.c 9 * matrixssl-3-7-2b-open/crypto/pubkey/pkcs.c
10 * matrixssl-3-7-2b-open/crypto/pubkey/rsa.c 10 * matrixssl-3-7-2b-open/crypto/pubkey/rsa.c
11 * and (so far) almost not modified. Changes are flagged with ///bbox 11 * and (so far) almost not modified. Changes are flagged with //bbox
12 */ 12 */
13 13
14#define pkcs1Pad(in, inlen, out, outlen, cryptType, userPtr) \ 14#define pkcs1Pad(in, inlen, out, outlen, cryptType, userPtr) \
15 pkcs1Pad(in, inlen, out, outlen, cryptType) 15 pkcs1Pad(in, inlen, out, outlen, cryptType)
16static ///bbox 16static //bbox
17int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out, 17int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out,
18 uint32 outlen, int32 cryptType, void *userPtr) 18 uint32 outlen, int32 cryptType, void *userPtr)
19{ 19{
@@ -57,8 +57,8 @@ int32 pkcs1Pad(unsigned char *in, uint32 inlen, unsigned char *out,
57} 57}
58 58
59#define psRsaCrypt(pool, in, inlen, out, outlen, key, type, data) \ 59#define psRsaCrypt(pool, in, inlen, out, outlen, key, type, data) \
60 psRsaCrypt(pool, in, inlen, out, outlen, key, type) 60 psRsaCrypt( in, inlen, out, outlen, key, type)
61static ///bbox 61static //bbox
62int32 psRsaCrypt(psPool_t *pool, const unsigned char *in, uint32 inlen, 62int32 psRsaCrypt(psPool_t *pool, const unsigned char *in, uint32 inlen,
63 unsigned char *out, uint32 *outlen, psRsaKey_t *key, int32 type, 63 unsigned char *out, uint32 *outlen, psRsaKey_t *key, int32 type,
64 void *data) 64 void *data)
@@ -67,10 +67,11 @@ int32 psRsaCrypt(psPool_t *pool, const unsigned char *in, uint32 inlen,
67 int32 res; 67 int32 res;
68 uint32 x; 68 uint32 x;
69 69
70 if (in == NULL || out == NULL || outlen == NULL || key == NULL) { 70//bbox
71 psTraceCrypto("NULL parameter error in psRsaCrypt\n"); 71// if (in == NULL || out == NULL || outlen == NULL || key == NULL) {
72 return PS_ARG_FAIL; 72// psTraceCrypto("NULL parameter error in psRsaCrypt\n");
73 } 73// return PS_ARG_FAIL;
74// }
74 75
75 tmp.dp = tmpa.dp = tmpb.dp = NULL; 76 tmp.dp = tmpa.dp = tmpb.dp = NULL;
76 77
@@ -187,7 +188,8 @@ int32 psRsaEncryptPub(psPool_t *pool, psRsaKey_t *key,
187 188
188 size = key->size; 189 size = key->size;
189 if (outlen < size) { 190 if (outlen < size) {
190 psTraceCrypto("Error on bad outlen parameter to psRsaEncryptPub: outlen:%d < size:%d", outlen, size); 191//bbox psTraceCrypto("Error on bad outlen parameter to psRsaEncryptPub\n");
192 bb_error_msg_and_die("RSA crypt outlen:%d < size:%d", outlen, size);
191 return PS_ARG_FAIL; 193 return PS_ARG_FAIL;
192 } 194 }
193 195