diff options
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_ht.c')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ht.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index af5fc16691..12bbfcffd1 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c | |||
@@ -397,12 +397,11 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx) | |||
397 | 397 | ||
398 | 398 | ||
399 | case OHS_ASN1_HEADER: | 399 | case OHS_ASN1_HEADER: |
400 | /* Now reading ASN1 header: can read at least 2 bytes which | 400 | /* Now reading ASN1 header: can read at least 6 bytes which |
401 | * is enough for ASN1 SEQUENCE header and either length field | 401 | * is more than enough for any valid ASN1 SEQUENCE header |
402 | * or at least the length of the length field. | ||
403 | */ | 402 | */ |
404 | n = BIO_get_mem_data(rctx->mem, &p); | 403 | n = BIO_get_mem_data(rctx->mem, &p); |
405 | if (n < 2) | 404 | if (n < 6) |
406 | goto next_io; | 405 | goto next_io; |
407 | 406 | ||
408 | /* Check it is an ASN1 SEQUENCE */ | 407 | /* Check it is an ASN1 SEQUENCE */ |
@@ -415,11 +414,6 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx) | |||
415 | /* Check out length field */ | 414 | /* Check out length field */ |
416 | if (*p & 0x80) | 415 | if (*p & 0x80) |
417 | { | 416 | { |
418 | /* If MSB set on initial length octet we can now | ||
419 | * always read 6 octets: make sure we have them. | ||
420 | */ | ||
421 | if (n < 6) | ||
422 | goto next_io; | ||
423 | n = *p & 0x7F; | 417 | n = *p & 0x7F; |
424 | /* Not NDEF or excessive length */ | 418 | /* Not NDEF or excessive length */ |
425 | if (!n || (n > 4)) | 419 | if (!n || (n > 4)) |