summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoug <>2015-02-07 02:02:28 +0000
committerdoug <>2015-02-07 02:02:28 +0000
commitd740eaab5e7724508dd84cde4e4268f487ee22e2 (patch)
tree106871a07b50e63cbfdb02cb2f24941eed5e60d9
parent42cc320a9587af3d4b4e742cf32ead4b5c14fc1d (diff)
downloadopenbsd-d740eaab5e7724508dd84cde4e4268f487ee22e2.tar.gz
openbsd-d740eaab5e7724508dd84cde4e4268f487ee22e2.tar.bz2
openbsd-d740eaab5e7724508dd84cde4e4268f487ee22e2.zip
Fix typo and ASN.1 tag number range comment in bytestring.h.
CBS_get_asn1() and CBS_get_any_asn1_element() only support the single byte ASN.1 identifier octets (aka short form tags). Tag number 31 is the start of the multi-byte long form per X.690 section 8.1.2.4. From BoringSSL commit 2683af70e73f116e14db2bca6290fa4a010a2ee4 ok miod@
-rw-r--r--src/lib/libssl/bytestring.h8
-rw-r--r--src/lib/libssl/src/ssl/bytestring.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libssl/bytestring.h b/src/lib/libssl/bytestring.h
index 09414af056..209bb38e24 100644
--- a/src/lib/libssl/bytestring.h
+++ b/src/lib/libssl/bytestring.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bytestring.h,v 1.2 2015/02/06 22:22:33 doug Exp $ */ 1/* $OpenBSD: bytestring.h,v 1.3 2015/02/07 02:02:28 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -56,7 +56,7 @@ void CBS_init(CBS *cbs, const uint8_t *data, size_t len);
56int CBS_skip(CBS *cbs, size_t len); 56int CBS_skip(CBS *cbs, size_t len);
57 57
58/* 58/*
59 * CBS_data returns a pointer to the contains of |cbs|. 59 * CBS_data returns a pointer to the contents of |cbs|.
60 */ 60 */
61const uint8_t *CBS_data(const CBS *cbs); 61const uint8_t *CBS_data(const CBS *cbs);
62 62
@@ -170,7 +170,7 @@ int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out);
170 * element must match |tag_value|. It returns one on success and zero 170 * element must match |tag_value|. It returns one on success and zero
171 * on error. 171 * on error.
172 * 172 *
173 * Tag numbers greater than 31 are not supported. 173 * Tag numbers greater than 30 are not supported (i.e. short form only).
174 */ 174 */
175int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value); 175int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
176 176
@@ -197,7 +197,7 @@ int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
197 * header. Each of |out|, |out_tag|, and |out_header_len| may be NULL to ignore 197 * header. Each of |out|, |out_tag|, and |out_header_len| may be NULL to ignore
198 * the value. 198 * the value.
199 * 199 *
200 * Tag numbers greater than 31 are not supported. 200 * Tag numbers greater than 30 are not supported (i.e. short form only).
201 */ 201 */
202int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, 202int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
203 size_t *out_header_len); 203 size_t *out_header_len);
diff --git a/src/lib/libssl/src/ssl/bytestring.h b/src/lib/libssl/src/ssl/bytestring.h
index 09414af056..209bb38e24 100644
--- a/src/lib/libssl/src/ssl/bytestring.h
+++ b/src/lib/libssl/src/ssl/bytestring.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bytestring.h,v 1.2 2015/02/06 22:22:33 doug Exp $ */ 1/* $OpenBSD: bytestring.h,v 1.3 2015/02/07 02:02:28 doug Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -56,7 +56,7 @@ void CBS_init(CBS *cbs, const uint8_t *data, size_t len);
56int CBS_skip(CBS *cbs, size_t len); 56int CBS_skip(CBS *cbs, size_t len);
57 57
58/* 58/*
59 * CBS_data returns a pointer to the contains of |cbs|. 59 * CBS_data returns a pointer to the contents of |cbs|.
60 */ 60 */
61const uint8_t *CBS_data(const CBS *cbs); 61const uint8_t *CBS_data(const CBS *cbs);
62 62
@@ -170,7 +170,7 @@ int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out);
170 * element must match |tag_value|. It returns one on success and zero 170 * element must match |tag_value|. It returns one on success and zero
171 * on error. 171 * on error.
172 * 172 *
173 * Tag numbers greater than 31 are not supported. 173 * Tag numbers greater than 30 are not supported (i.e. short form only).
174 */ 174 */
175int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value); 175int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value);
176 176
@@ -197,7 +197,7 @@ int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value);
197 * header. Each of |out|, |out_tag|, and |out_header_len| may be NULL to ignore 197 * header. Each of |out|, |out_tag|, and |out_header_len| may be NULL to ignore
198 * the value. 198 * the value.
199 * 199 *
200 * Tag numbers greater than 31 are not supported. 200 * Tag numbers greater than 30 are not supported (i.e. short form only).
201 */ 201 */
202int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, 202int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
203 size_t *out_header_len); 203 size_t *out_header_len);