-/* $OpenBSD: bs_cbb.c,v 1.29 2024/05/25 15:14:26 tb Exp $ */
+/* $OpenBSD: bs_cbb.c,v 1.30 2024/06/22 15:25:06 jsing Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
return cbb_add_length_prefixed(cbb, out_contents, 3);
}
+int
+CBB_add_u32_length_prefixed(CBB *cbb, CBB *out_contents)
+{
+ return cbb_add_length_prefixed(cbb, out_contents, 4);
+}
+
int
CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned int tag)
{
-/* $OpenBSD: bytestring.h,v 1.24 2022/11/09 23:14:51 jsing Exp $ */
+/* $OpenBSD: bytestring.h,v 1.25 2024/06/22 15:25:06 jsing Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
*/
int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents);
+/*
+ * CBB_add_u32_length_prefixed sets |*out_contents| to a new child of |cbb|.
+ * The data written to |*out_contents| will be prefixed in |cbb| with a 32-bit,
+ * big-endian length. It returns one on success or zero on error.
+ */
+int CBB_add_u32_length_prefixed(CBB *cbb, CBB *out_contents);
+
/*
* CBB_add_asn sets |*out_contents| to a |CBB| into which the contents of an
* ASN.1 object can be written. The |tag| argument will be used as the tag for