Document that EVP_EncodeBlock writes a trailing NUL.
Fix base64_test.c to account for this. Change-Id: I0b3e8062a2130fb01a7e6f175968484769c406f9 Reviewed-on: https://boringssl-review.googlesource.com/1250 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
6defe177fe
commit
13f2710c37
@ -38,7 +38,7 @@ static const TEST_VECTOR test_vectors[] = {
|
||||
static const size_t kNumTests = sizeof(test_vectors) / sizeof(test_vectors[0]);
|
||||
|
||||
static int test_encode() {
|
||||
uint8_t out[8];
|
||||
uint8_t out[9];
|
||||
size_t i;
|
||||
ssize_t len;
|
||||
|
||||
|
@ -94,8 +94,9 @@ void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len,
|
||||
* sets |*out_len| to the number of bytes written. */
|
||||
void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len);
|
||||
|
||||
/* EVP_EncodeBlock encodes |src_len| bytes from |src| and writes the result to
|
||||
* |dst|. It returns the number of bytes written. */
|
||||
/* EVP_EncodeBlock encodes |src_len| bytes from |src| and writes the
|
||||
* result to |dst| with a trailing NUL. It returns the number of bytes
|
||||
* written, not including this trailing NUL. */
|
||||
size_t EVP_EncodeBlock(uint8_t *dst, const uint8_t *src, size_t src_len);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user