File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,18 @@ TLS-init-cipher-suite: func [
413
413
]
414
414
]
415
415
416
+ pad-bin : function [
417
+ "Left binary padding"
418
+ bin [binary! ]
419
+ len [integer! ]
420
+ ] [
421
+ if len > n: length? bin [
422
+ ; using copy, because binary may not be at its head!
423
+ insert /dup copy bin 0 len - n
424
+ ]
425
+ bin
426
+ ]
427
+
416
428
make-TLS-error : func [
417
429
"Make an error for the TLS protocol"
418
430
message [string! block! ]
@@ -1599,8 +1611,10 @@ TLS-parse-handshake-message: function [
1599
1611
rsa_fixed_dh [
1600
1612
log-more "Checking signature using RSA_fixed_DH"
1601
1613
der: decode 'der signature
1602
- ;@@ Review: der codec skips null char, which is needed here (reason for `head` calls)!
1603
- signature: join head der/2/2 head der/2/4
1614
+ n: select [secp256r1 32 secp384r1 48 secp521r1 66 ] ctx/pub-exp
1615
+ x: pad-bin der/2/2 n
1616
+ y: pad-bin der/2/4 n
1617
+ signature: join x y
1604
1618
;? ctx/pub-key
1605
1619
;? signature
1606
1620
;? ctx/pub-key
You can’t perform that action at this time.
0 commit comments