diff options
Diffstat (limited to 'src/lib/libssl/bytestring.h')
| -rw-r--r-- | src/lib/libssl/bytestring.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/libssl/bytestring.h b/src/lib/libssl/bytestring.h index ef824a0cea..07be6ddd50 100644 --- a/src/lib/libssl/bytestring.h +++ b/src/lib/libssl/bytestring.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bytestring.h,v 1.8 2015/06/16 06:11:39 doug Exp $ */ | 1 | /* $OpenBSD: bytestring.h,v 1.9 2015/06/16 06:37:58 doug Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
| 4 | * | 4 | * |
| @@ -464,22 +464,23 @@ int cbs_get_any_asn1_element_internal(CBS *cbs, CBS *out, unsigned *out_tag, | |||
| 464 | size_t *out_header_len, int strict); | 464 | size_t *out_header_len, int strict); |
| 465 | 465 | ||
| 466 | /* | 466 | /* |
| 467 | * CBS_asn1_ber_to_der reads an ASN.1 structure from |in|. If it finds | 467 | * CBS_asn1_indefinite_to_definite reads an ASN.1 structure from |in|. If it |
| 468 | * indefinite-length elements then it attempts to convert the BER data to DER | 468 | * finds indefinite-length elements that otherwise appear to be valid DER, it |
| 469 | * and sets |*out| and |*out_length| to describe a malloced buffer containing | 469 | * attempts to convert the DER-like data to DER and sets |*out| and |
| 470 | * the DER data. Additionally, |*in| will be advanced over the ASN.1 data. | 470 | * |*out_length| to describe a malloced buffer containing the DER data. |
| 471 | * Additionally, |*in| will be advanced over the ASN.1 data. | ||
| 471 | * | 472 | * |
| 472 | * If it doesn't find any indefinite-length elements then it sets |*out| to | 473 | * If it doesn't find any indefinite-length elements then it sets |*out| to |
| 473 | * NULL and |*in| is unmodified. | 474 | * NULL and |*in| is unmodified. |
| 474 | * | 475 | * |
| 475 | * A sufficiently complex ASN.1 structure will break this function because it's | 476 | * This is NOT a conversion from BER to DER. There are many restrictions when |
| 476 | * not possible to generically convert BER to DER without knowledge of the | 477 | * dealing with DER data. This is only concerned with one: indefinite vs. |
| 477 | * structure itself. However, this sufficies to handle the PKCS#7 and #12 output | 478 | * definite form. However, this suffices to handle the PKCS#7 and PKCS#12 output |
| 478 | * from NSS. | 479 | * from NSS. |
| 479 | * | 480 | * |
| 480 | * It returns one on success and zero otherwise. | 481 | * It returns one on success and zero otherwise. |
| 481 | */ | 482 | */ |
| 482 | int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len); | 483 | int CBS_asn1_indefinite_to_definite(CBS *in, uint8_t **out, size_t *out_len); |
| 483 | #endif /* LIBRESSL_INTERNAL */ | 484 | #endif /* LIBRESSL_INTERNAL */ |
| 484 | 485 | ||
| 485 | #if defined(__cplusplus) | 486 | #if defined(__cplusplus) |
