Skip to content

Commit 112c087

Browse files
committed
FIX: RSA related memory leak in TLS protocol
1 parent a106038 commit 112c087

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mezz/prot-tls.reb

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ REBOL [
33
name: 'tls
44
type: 'module
55
author: rights: ["Richard 'Cyphre' Smolak" "Oldes" "Brian Dickens (Hostilefork)"]
6-
version: 0.7.1
6+
version: 0.7.3
77
history: [
88
0.6.1 "Cyphre" "Initial implementation used in old R3-alpha"
99
0.7.0 "Oldes" {
@@ -20,6 +20,7 @@ REBOL [
2020
* Basic support for EllipticCurves (x25519 still missing)
2121
* Added support for Chacha20-Poly1305 cipher suite
2222
}
23+
0.7.3 "Oldes" "Fixed RSA memory leak"
2324
]
2425
todo: {
2526
* cached sessions
@@ -629,6 +630,7 @@ client-key-exchange: function [
629630
key-data: rsa/encrypt rsa-key pre-master-secret
630631
key-data-len-bytes: 2
631632
log-more ["W[" ctx/seq-write "] key-data:" mold key-data]
633+
rsa rsa-key none ;@@ releases the internal RSA data, should be done by GC one day!
632634
]
633635
DHE_DSS
634636
DHE_RSA [
@@ -1578,6 +1580,7 @@ TLS-parse-handshake-message: function [
15781580
;decrypt the `signature` with server's public key
15791581
rsa-key: apply :rsa-init ctx/server-certs/1/public-key/rsaEncryption
15801582
signature: rsa/verify rsa-key signature
1583+
rsa rsa-key none ;@@ releases the internal RSA data, should be done by GC one day!
15811584
;?? signature
15821585
signature: decode 'der signature
15831586
;note tls1.3 is different a little bit here!

0 commit comments

Comments
 (0)