summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-08-16 18:40:19 +0000
committerjsing <>2018-08-16 18:40:19 +0000
commit9c8ed9fc37dd34af232404d0945d2667da72cef3 (patch)
tree5238136d110012db03d27a3255d747450f0d24e2
parenteb48423b94c2e66042a8a033b5e28d9b819e5305 (diff)
downloadopenbsd-9c8ed9fc37dd34af232404d0945d2667da72cef3.tar.gz
openbsd-9c8ed9fc37dd34af232404d0945d2667da72cef3.tar.bz2
openbsd-9c8ed9fc37dd34af232404d0945d2667da72cef3.zip
Add regress coverage for CBB_add_u32().
-rw-r--r--src/regress/lib/libssl/bytestring/bytestringtest.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/regress/lib/libssl/bytestring/bytestringtest.c b/src/regress/lib/libssl/bytestring/bytestringtest.c
index a260ede2a2..0e9f5f47e5 100644
--- a/src/regress/lib/libssl/bytestring/bytestringtest.c
+++ b/src/regress/lib/libssl/bytestring/bytestringtest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bytestringtest.c,v 1.11 2017/11/28 16:35:05 jsing Exp $ */ 1/* $OpenBSD: bytestringtest.c,v 1.12 2018/08/16 18:40:19 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014, Google Inc. 3 * Copyright (c) 2014, Google Inc.
4 * 4 *
@@ -268,7 +268,7 @@ test_get_optional_asn1_bool(void)
268static int 268static int
269test_cbb_basic(void) 269test_cbb_basic(void)
270{ 270{
271 static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8}; 271 static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
272 uint8_t *buf = NULL; 272 uint8_t *buf = NULL;
273 size_t buf_len; 273 size_t buf_len;
274 int ret = 0; 274 int ret = 0;
@@ -282,7 +282,8 @@ test_cbb_basic(void)
282 CHECK_GOTO(CBB_add_u8(&cbb, 1)); 282 CHECK_GOTO(CBB_add_u8(&cbb, 1));
283 CHECK_GOTO(CBB_add_u16(&cbb, 0x203)); 283 CHECK_GOTO(CBB_add_u16(&cbb, 0x203));
284 CHECK_GOTO(CBB_add_u24(&cbb, 0x40506)); 284 CHECK_GOTO(CBB_add_u24(&cbb, 0x40506));
285 CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x07\x08", 2)); 285 CHECK_GOTO(CBB_add_u32(&cbb, 0x708090a));
286 CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x0b\x0c", 2));
286 CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len)); 287 CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len));
287 288
288 ret = (buf_len == sizeof(kExpected) 289 ret = (buf_len == sizeof(kExpected)