diff options
| author | doug <> | 2015-06-19 00:23:36 +0000 |
|---|---|---|
| committer | doug <> | 2015-06-19 00:23:36 +0000 |
| commit | 512915f28ea9c781f7fb047c687e3863fa3168b7 (patch) | |
| tree | 0c2bf824ab545d4f85a730e504864d99df649f58 /src/lib/libssl/bytestring.h | |
| parent | d475c1337d104a1f41d2c0db1ab61eb9f8f214ed (diff) | |
| download | openbsd-512915f28ea9c781f7fb047c687e3863fa3168b7.tar.gz openbsd-512915f28ea9c781f7fb047c687e3863fa3168b7.tar.bz2 openbsd-512915f28ea9c781f7fb047c687e3863fa3168b7.zip | |
Add CBS_dup() to initialize a new CBS with the same values.
This is useful for when you need to check the data ahead and then continue
on from the same spot.
input + ok jsing@ miod@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/bytestring.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libssl/bytestring.h b/src/lib/libssl/bytestring.h index 4c9d4d8884..8ea84005b4 100644 --- a/src/lib/libssl/bytestring.h +++ b/src/lib/libssl/bytestring.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bytestring.h,v 1.13 2015/06/18 23:25:07 doug Exp $ */ | 1 | /* $OpenBSD: bytestring.h,v 1.14 2015/06/19 00:23:36 doug Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
| 4 | * | 4 | * |
| @@ -466,6 +466,12 @@ int CBB_add_asn1_uint64(CBB *cbb, uint64_t value); | |||
| 466 | 466 | ||
| 467 | #ifdef LIBRESSL_INTERNAL | 467 | #ifdef LIBRESSL_INTERNAL |
| 468 | /* | 468 | /* |
| 469 | * CBS_dup sets |out| to point to cbs's |data| and |len|. It results in two | ||
| 470 | * CBS that point to the same buffer. | ||
| 471 | */ | ||
| 472 | void CBS_dup(const CBS *cbs, CBS *out); | ||
| 473 | |||
| 474 | /* | ||
| 469 | * cbs_get_any_asn1_element sets |*out| to contain the next ASN.1 element from | 475 | * cbs_get_any_asn1_element sets |*out| to contain the next ASN.1 element from |
| 470 | * |*cbs| (including header bytes) and advances |*cbs|. It sets |*out_tag| to | 476 | * |*cbs| (including header bytes) and advances |*cbs|. It sets |*out_tag| to |
| 471 | * the tag number and |*out_header_len| to the length of the ASN.1 header. If | 477 | * the tag number and |*out_header_len| to the length of the ASN.1 header. If |
