Skip to content

Commit b715b43

Browse files
committed
Fixed buffer overflow in private key decoding (wrong buffer length used in size check).
1 parent 2893441 commit b715b43

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/x509/skey_decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static const unsigned char t0_codeblock[] = {
155155
0x02, 0x06, 0x1E, 0x00, 0x00, 0x19, 0x19, 0x00, 0x00, 0x01, 0x0B, 0x00,
156156
0x00, 0x01, 0x00, 0x20, 0x14, 0x06, 0x08, 0x01, 0x01, 0x21, 0x20, 0x22,
157157
0x20, 0x04, 0x75, 0x13, 0x00, 0x00, 0x01,
158-
T0_INT2(3 * BR_X509_BUFSIZE_KEY), 0x00, 0x01, 0x01, 0x87, 0xFF, 0xFF,
158+
T0_INT2(3 * BR_X509_BUFSIZE_SIG), 0x00, 0x01, 0x01, 0x87, 0xFF, 0xFF,
159159
0x7F, 0x54, 0x57, 0x01, 0x02, 0x3E, 0x55, 0x01, 0x01, 0x0E, 0x06, 0x02,
160160
0x30, 0x16, 0x57, 0x01, 0x02, 0x19, 0x0D, 0x06, 0x06, 0x13, 0x3B, 0x44,
161161
0x32, 0x04, 0x1C, 0x01, 0x04, 0x19, 0x0D, 0x06, 0x08, 0x13, 0x3B, 0x01,

src/x509/skey_decoder.t0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ cc: read-blob-inner ( addr len -- addr len ) {
8080

8181
\ Get the length of the key_data buffer.
8282
: len-key_data
83-
CX 0 8191 { 3 * BR_X509_BUFSIZE_KEY } ;
83+
CX 0 8191 { 3 * BR_X509_BUFSIZE_SIG } ;
8484

8585
\ Get the address and length for the key_data buffer.
8686
: addr-len-key_data ( -- addr len )

0 commit comments

Comments
 (0)