aboutsummaryrefslogtreecommitdiff
path: root/networking/tls_rsa.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-19 15:51:00 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-19 15:51:00 +0100
commit6b1b004845ebec194c4d4868d3deb57f22711b19 (patch)
tree291b2cf65b5537a184369eabec0089420ed63930 /networking/tls_rsa.c
parent1bfc4b85a7915210936edc62ecf0d01a17751222 (diff)
downloadbusybox-w32-6b1b004845ebec194c4d4868d3deb57f22711b19.tar.gz
busybox-w32-6b1b004845ebec194c4d4868d3deb57f22711b19.tar.bz2
busybox-w32-6b1b004845ebec194c4d4868d3deb57f22711b19.zip
tls: commented out psPool_t use
function old new delta psAesEncrypt 159 162 +3 der_binary_to_pstm 42 40 -2 xwrite_and_hash 437 434 -3 xread_tls_block 446 443 -3 pstm_div_2d 449 444 -5 psAesDecrypt 179 174 -5 pstm_init_size 52 45 -7 pstm_init 46 39 -7 pstm_to_unsigned_bin 165 157 -8 tls_main 1265 1256 -9 pstm_mulmod 132 123 -9 pstm_mod 125 116 -9 pstm_init_copy 93 84 -9 psAesInitKey 840 825 -15 send_client_key_exchange 362 342 -20 psAesInit 103 80 -23 psRsaEncryptPub 429 403 -26 psAesDecryptBlock 1211 1184 -27 psAesEncryptBlock 1223 1193 -30 pstm_exptmod 1582 1524 -58 pstm_div 1557 1472 -85 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/20 up/down: 3/-360) Total: -357 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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