diff options
-rw-r--r-- | networking/tls.c | 1 | ||||
-rw-r--r-- | networking/tls_rsa.h | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/networking/tls.c b/networking/tls.c index 9b4298de7..9833a0adb 100644 --- a/networking/tls.c +++ b/networking/tls.c | |||
@@ -2168,6 +2168,7 @@ void FAST_FUNC tls_handshake(tls_state_t *tls, const char *sni) | |||
2168 | /* application data can be sent/received */ | 2168 | /* application data can be sent/received */ |
2169 | 2169 | ||
2170 | /* free handshake data */ | 2170 | /* free handshake data */ |
2171 | psRsaKey_clear(&tls->hsd->server_rsa_pub_key); | ||
2171 | // if (PARANOIA) | 2172 | // if (PARANOIA) |
2172 | // memset(tls->hsd, 0, tls->hsd->hsd_size); | 2173 | // memset(tls->hsd, 0, tls->hsd->hsd_size); |
2173 | free(tls->hsd); | 2174 | free(tls->hsd); |
diff --git a/networking/tls_rsa.h b/networking/tls_rsa.h index f42923ff5..82bea2a67 100644 --- a/networking/tls_rsa.h +++ b/networking/tls_rsa.h | |||
@@ -13,6 +13,18 @@ typedef struct { | |||
13 | //bbox psPool_t *pool; | 13 | //bbox psPool_t *pool; |
14 | } psRsaKey_t; | 14 | } psRsaKey_t; |
15 | 15 | ||
16 | static ALWAYS_INLINE void psRsaKey_clear(psRsaKey_t *key) | ||
17 | { | ||
18 | pstm_clear(&key->N); | ||
19 | pstm_clear(&key->e); | ||
20 | pstm_clear(&key->d); | ||
21 | pstm_clear(&key->p); | ||
22 | pstm_clear(&key->q); | ||
23 | pstm_clear(&key->dP); | ||
24 | pstm_clear(&key->dQ); | ||
25 | pstm_clear(&key->qP); | ||
26 | } | ||
27 | |||
16 | #define psRsaEncryptPub(pool, key, in, inlen, out, outlen, data) \ | 28 | #define psRsaEncryptPub(pool, key, in, inlen, out, outlen, data) \ |
17 | psRsaEncryptPub( key, in, inlen, out, outlen) | 29 | psRsaEncryptPub( key, in, inlen, out, outlen) |
18 | int32 psRsaEncryptPub(psPool_t *pool, psRsaKey_t *key, | 30 | int32 psRsaEncryptPub(psPool_t *pool, psRsaKey_t *key, |