diff options
author | doug <> | 2015-06-17 07:06:22 +0000 |
---|---|---|
committer | doug <> | 2015-06-17 07:06:22 +0000 |
commit | 1a6ec4dba6f1322011c578d9ef1a3d4898ddfacd (patch) | |
tree | 93fbc20cc8335f820378205df913c380ea091808 /src/lib/libssl/bytestring.h | |
parent | 7489a76f28fc9e40d91abd387e7e07cf8e913e7e (diff) | |
download | openbsd-1a6ec4dba6f1322011c578d9ef1a3d4898ddfacd.tar.gz openbsd-1a6ec4dba6f1322011c578d9ef1a3d4898ddfacd.tar.bz2 openbsd-1a6ec4dba6f1322011c578d9ef1a3d4898ddfacd.zip |
Add CBS_write_bytes() to copy the remaining CBS bytes to the caller.
This is a common operation when dealing with CBS.
ok miod@ jsing@
Diffstat (limited to 'src/lib/libssl/bytestring.h')
-rw-r--r-- | src/lib/libssl/bytestring.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libssl/bytestring.h b/src/lib/libssl/bytestring.h index 80ca00d77a..2eb18e207d 100644 --- a/src/lib/libssl/bytestring.h +++ b/src/lib/libssl/bytestring.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bytestring.h,v 1.10 2015/06/17 07:00:22 doug Exp $ */ | 1 | /* $OpenBSD: bytestring.h,v 1.11 2015/06/17 07:06:22 doug Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
4 | * | 4 | * |
@@ -92,6 +92,14 @@ int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len); | |||
92 | int CBS_strdup(const CBS *cbs, char **out_ptr); | 92 | int CBS_strdup(const CBS *cbs, char **out_ptr); |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * CBS_write_bytes writes all of the remaining data from |cbs| into |dst| | ||
96 | * if it is at most |dst_len| bytes. If |copied| is not NULL, it will be set | ||
97 | * to the amount copied. It returns one on success and zero otherwise. | ||
98 | */ | ||
99 | int CBS_write_bytes(const CBS *cbs, uint8_t *dst, size_t dst_len, | ||
100 | size_t *copied); | ||
101 | |||
102 | /* | ||
95 | * CBS_contains_zero_byte returns one if the current contents of |cbs| contains | 103 | * CBS_contains_zero_byte returns one if the current contents of |cbs| contains |
96 | * a NUL byte and zero otherwise. | 104 | * a NUL byte and zero otherwise. |
97 | */ | 105 | */ |