Skip to content

Commit 8a63f42

Browse files
committed
FIX: minor cleanup in TLS protocol
1 parent 2dbcf33 commit 8a63f42

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/mezz/prot-tls.r

+2-24
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ TLS-parse-handshake-message: function [
14741474
]
14751475
log-more ["Received" length? ctx/server-certs "server certificates."]
14761476
;? ctx/server-certs
1477-
if error? try [
1477+
try/except [
14781478
;?? ctx/server-certs/1/public-key
14791479
;?? ctx/server-certs/1
14801480
key: ctx/server-certs/1/public-key
@@ -1503,34 +1503,16 @@ TLS-parse-handshake-message: function [
15031503
ECDHE_RSA
15041504
ECDHE_ECDSA [
15051505
;? msg/buffer
1506-
if error? err: try [
1506+
try/except [
15071507
binary/read msg [
15081508
s: INDEX
15091509
ECCurveType: UI8
15101510
ECCurve: UI16 ; IANA CURVE NUMBER
15111511
pub_key: UI8BYTES
15121512
e: INDEX
15131513
]
1514-
;@@ TODO: remove this if there will not be any issues!
1515-
;if not empty? msg/buffer [
1516-
; binary/read msg [
1517-
; hash-algorithm: UI8
1518-
; sign-algorithm: UI8
1519-
; der: UI16BYTES
1520-
; ]
1521-
; log-info [
1522-
; "Algorithms-> hash:" *HashAlgorithm/name hash-algorithm "(" hash-algorithm ")"
1523-
; "sign:" *ClientCertificateType/name sign-algorithm "(" sign-algorithm ")"
1524-
; ]
1525-
; ;? sign-algorithm ; should be 1027 (ecdsa_secp256r1_sha256)
1526-
; if sign-algorithm = *SignatureAlgorithm/ecdsa
1527-
; der: system/codecs/der/decode der
1528-
; ?? der
1529-
; ]
1530-
;]
15311514
][
15321515
log-error "Error reading elyptic curve"
1533-
? err
15341516
return *Alert/User_cancelled
15351517
]
15361518

@@ -1544,10 +1526,6 @@ TLS-parse-handshake-message: function [
15441526
]
15451527
log-more ["R[" ctx/seq-read "] Elyptic curve type:" ECCurve "=>" curve]
15461528
log-more ["R[" ctx/seq-read "] Elyptic curve data:" pub_key]
1547-
;@@ TODO: remove this if there will not be any issues!
1548-
;if der [
1549-
; log-more ["R[" ctx/seq-read "] Elyptic curve signature:" mold der]
1550-
;]
15511529
]
15521530
DHE_DSS
15531531
DHE_RSA [

0 commit comments

Comments
 (0)