blob: 982414626e855d049a4197deceaf86b7444ae4e0 [file] [log] [blame]
Paul Bakkerbdb912d2012-02-13 23:11:30 +00001/**
2 * \file asn1write.h
3 *
4 * \brief ASN.1 buffer writing functionality
Darryl Greena40a1012018-01-05 15:33:17 +00005 */
6/*
Manuel Pégourié-Gonnard6fb81872015-07-27 11:11:48 +02007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02008 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
Paul Bakkerbdb912d2012-02-13 23:11:30 +000021 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000022 * This file is part of mbed TLS (https://tls.mbed.org)
Paul Bakkerbdb912d2012-02-13 23:11:30 +000023 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020024#ifndef MBEDTLS_ASN1_WRITE_H
25#define MBEDTLS_ASN1_WRITE_H
Paul Bakkerbdb912d2012-02-13 23:11:30 +000026
Ron Eldor8b0cf2e2018-02-14 16:02:41 +020027#if !defined(MBEDTLS_CONFIG_FILE)
Jaeden Ameroc49fbbf2019-07-04 20:01:14 +010028#include "mbedtls/config.h"
Ron Eldor8b0cf2e2018-02-14 16:02:41 +020029#else
30#include MBEDTLS_CONFIG_FILE
31#endif
32
Jaeden Ameroc49fbbf2019-07-04 20:01:14 +010033#include "mbedtls/asn1.h"
Paul Bakkerbdb912d2012-02-13 23:11:30 +000034
Hanno Becker55177552018-10-24 12:29:53 +010035#define MBEDTLS_ASN1_CHK_ADD(g, f) \
Hanno Becker1eeca412018-10-15 12:01:35 +010036 do \
37 { \
38 if( ( ret = (f) ) < 0 ) \
Hanno Becker55177552018-10-24 12:29:53 +010039 return( ret ); \
40 else \
Hanno Becker1eeca412018-10-15 12:01:35 +010041 (g) += ret; \
Hanno Becker55177552018-10-24 12:29:53 +010042 } while( 0 )
Paul Bakkerbdb912d2012-02-13 23:11:30 +000043
Paul Bakker407a0da2013-06-27 14:29:21 +020044#ifdef __cplusplus
45extern "C" {
46#endif
47
Paul Bakker7accbce2013-08-26 17:34:53 +020048/**
Hanno Becker55177552018-10-24 12:29:53 +010049 * \brief Write a length field in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +020050 *
Hanno Becker55177552018-10-24 12:29:53 +010051 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +020052 *
Hanno Becker55177552018-10-24 12:29:53 +010053 * \param p The reference to the current position pointer.
54 * \param start The start of the buffer, for bounds-checking.
55 * \param len The length value to write.
56 *
57 * \return The number of bytes written to \p p on success.
58 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +020059 */
Hanno Becker55177552018-10-24 12:29:53 +010060int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start,
61 size_t len );
Paul Bakker7accbce2013-08-26 17:34:53 +020062/**
Hanno Becker55177552018-10-24 12:29:53 +010063 * \brief Write an ASN.1 tag in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +020064 *
Hanno Becker55177552018-10-24 12:29:53 +010065 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +020066 *
Hanno Becker55177552018-10-24 12:29:53 +010067 * \param p The reference to the current position pointer.
68 * \param start The start of the buffer, for bounds-checking.
69 * \param tag The tag to write.
70 *
71 * \return The number of bytes written to \p p on success.
72 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +020073 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020074int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +010075 unsigned char tag );
Paul Bakker7accbce2013-08-26 17:34:53 +020076
Paul Bakker9852d002013-08-26 17:56:37 +020077/**
Hanno Becker55177552018-10-24 12:29:53 +010078 * \brief Write raw buffer data.
Paul Bakker9852d002013-08-26 17:56:37 +020079 *
Hanno Becker55177552018-10-24 12:29:53 +010080 * \note This function works backwards in data buffer.
Paul Bakker9852d002013-08-26 17:56:37 +020081 *
Hanno Becker55177552018-10-24 12:29:53 +010082 * \param p The reference to the current position pointer.
83 * \param start The start of the buffer, for bounds-checking.
84 * \param buf The data buffer to write.
85 * \param size The length of the data buffer.
86 *
87 * \return The number of bytes written to \p p on success.
88 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker9852d002013-08-26 17:56:37 +020089 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020090int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +010091 const unsigned char *buf, size_t size );
Paul Bakker9852d002013-08-26 17:56:37 +020092
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020093#if defined(MBEDTLS_BIGNUM_C)
Paul Bakker7accbce2013-08-26 17:34:53 +020094/**
Hanno Becker55177552018-10-24 12:29:53 +010095 * \brief Write a arbitrary-precision number (#MBEDTLS_ASN1_INTEGER)
96 * in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +020097 *
Hanno Becker55177552018-10-24 12:29:53 +010098 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +020099 *
Hanno Becker55177552018-10-24 12:29:53 +0100100 * \param p The reference to the current position pointer.
101 * \param start The start of the buffer, for bounds-checking.
102 * \param X The MPI to write.
Gilles Peskine105031b2019-03-01 19:28:41 +0100103 * It must be non-negative.
Hanno Becker55177552018-10-24 12:29:53 +0100104 *
105 * \return The number of bytes written to \p p on success.
106 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200107 */
Hanno Becker55177552018-10-24 12:29:53 +0100108int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start,
109 const mbedtls_mpi *X );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200110#endif /* MBEDTLS_BIGNUM_C */
Paul Bakker7accbce2013-08-26 17:34:53 +0200111
112/**
Hanno Becker55177552018-10-24 12:29:53 +0100113 * \brief Write a NULL tag (#MBEDTLS_ASN1_NULL) with zero data
114 * in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200115 *
Hanno Becker55177552018-10-24 12:29:53 +0100116 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200117 *
Hanno Becker55177552018-10-24 12:29:53 +0100118 * \param p The reference to the current position pointer.
119 * \param start The start of the buffer, for bounds-checking.
120 *
121 * \return The number of bytes written to \p p on success.
122 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200123 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200124int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start );
Paul Bakker7accbce2013-08-26 17:34:53 +0200125
126/**
Hanno Becker55177552018-10-24 12:29:53 +0100127 * \brief Write an OID tag (#MBEDTLS_ASN1_OID) and data
128 * in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200129 *
Hanno Becker55177552018-10-24 12:29:53 +0100130 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200131 *
Hanno Becker55177552018-10-24 12:29:53 +0100132 * \param p The reference to the current position pointer.
133 * \param start The start of the buffer, for bounds-checking.
134 * \param oid The OID to write.
135 * \param oid_len The length of the OID.
136 *
137 * \return The number of bytes written to \p p on success.
138 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200139 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200140int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +0100141 const char *oid, size_t oid_len );
Paul Bakker7accbce2013-08-26 17:34:53 +0200142
143/**
Hanno Becker55177552018-10-24 12:29:53 +0100144 * \brief Write an AlgorithmIdentifier sequence in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200145 *
Hanno Becker55177552018-10-24 12:29:53 +0100146 * \note This function works backwards in data buffer.
147 *
148 * \param p The reference to the current position pointer.
149 * \param start The start of the buffer, for bounds-checking.
150 * \param oid The OID of the algorithm to write.
151 * \param oid_len The length of the algorithm's OID.
152 * \param par_len The length of the parameters, which must be already written.
Manuel Pégourié-Gonnardedda9042013-09-12 02:17:54 +0200153 * If 0, NULL parameters are added
Paul Bakker7accbce2013-08-26 17:34:53 +0200154 *
Hanno Becker55177552018-10-24 12:29:53 +0100155 * \return The number of bytes written to \p p on success.
156 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200157 */
Hanno Becker55177552018-10-24 12:29:53 +0100158int mbedtls_asn1_write_algorithm_identifier( unsigned char **p,
159 unsigned char *start,
160 const char *oid, size_t oid_len,
161 size_t par_len );
Paul Bakker7accbce2013-08-26 17:34:53 +0200162
163/**
Hanno Becker55177552018-10-24 12:29:53 +0100164 * \brief Write a boolean tag (#MBEDTLS_ASN1_BOOLEAN) and value
165 * in ASN.1 format.
Paul Bakker329def32013-09-06 16:34:38 +0200166 *
Hanno Becker55177552018-10-24 12:29:53 +0100167 * \note This function works backwards in data buffer.
Paul Bakker329def32013-09-06 16:34:38 +0200168 *
Hanno Becker55177552018-10-24 12:29:53 +0100169 * \param p The reference to the current position pointer.
170 * \param start The start of the buffer, for bounds-checking.
171 * \param boolean The boolean value to write, either \c 0 or \c 1.
172 *
173 * \return The number of bytes written to \p p on success.
174 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker329def32013-09-06 16:34:38 +0200175 */
Hanno Becker55177552018-10-24 12:29:53 +0100176int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
177 int boolean );
Paul Bakker329def32013-09-06 16:34:38 +0200178
179/**
Hanno Becker55177552018-10-24 12:29:53 +0100180 * \brief Write an int tag (#MBEDTLS_ASN1_INTEGER) and value
181 * in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200182 *
Hanno Becker55177552018-10-24 12:29:53 +0100183 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200184 *
Hanno Becker55177552018-10-24 12:29:53 +0100185 * \param p The reference to the current position pointer.
186 * \param start The start of the buffer, for bounds-checking.
187 * \param val The integer value to write.
Gilles Peskine105031b2019-03-01 19:28:41 +0100188 * It must be non-negative.
Hanno Becker55177552018-10-24 12:29:53 +0100189 *
190 * \return The number of bytes written to \p p on success.
191 * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200192 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200193int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val );
Paul Bakker7accbce2013-08-26 17:34:53 +0200194
195/**
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100196 * \brief Write a string in ASN.1 format using a specific
197 * string encoding tag.
Hanno Becker55177552018-10-24 12:29:53 +0100198
199 * \note This function works backwards in data buffer.
Jaeden Amero23f954d2018-05-17 11:46:13 +0100200 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100201 * \param p The reference to the current position pointer.
Hanno Becker55177552018-10-24 12:29:53 +0100202 * \param start The start of the buffer, for bounds-checking.
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100203 * \param tag The string encoding tag to write, e.g.
204 * #MBEDTLS_ASN1_UTF8_STRING.
205 * \param text The string to write.
206 * \param text_len The length of \p text in bytes (which might
207 * be strictly larger than the number of characters).
Jaeden Amero23f954d2018-05-17 11:46:13 +0100208 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100209 * \return The number of bytes written to \p p on success.
210 * \return A negative error code on failure.
Jaeden Amero23f954d2018-05-17 11:46:13 +0100211 */
thomas-deeeba6c9b2018-09-19 09:10:37 +0200212int mbedtls_asn1_write_tagged_string( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +0100213 int tag, const char *text,
214 size_t text_len );
Paul Bakker7accbce2013-08-26 17:34:53 +0200215
216/**
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100217 * \brief Write a string in ASN.1 format using the PrintableString
218 * string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING).
Hanno Becker55177552018-10-24 12:29:53 +0100219 *
220 * \note This function works backwards in data buffer.
Jaeden Amero23f954d2018-05-17 11:46:13 +0100221 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100222 * \param p The reference to the current position pointer.
Hanno Becker55177552018-10-24 12:29:53 +0100223 * \param start The start of the buffer, for bounds-checking.
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100224 * \param text The string to write.
225 * \param text_len The length of \p text in bytes (which might
226 * be strictly larger than the number of characters).
Jaeden Amero23f954d2018-05-17 11:46:13 +0100227 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100228 * \return The number of bytes written to \p p on success.
229 * \return A negative error code on failure.
230 */
231int mbedtls_asn1_write_printable_string( unsigned char **p,
232 unsigned char *start,
233 const char *text, size_t text_len );
234
235/**
236 * \brief Write a UTF8 string in ASN.1 format using the UTF8String
Gilles Peskine105031b2019-03-01 19:28:41 +0100237 * string encoding tag (#MBEDTLS_ASN1_UTF8_STRING).
Hanno Becker55177552018-10-24 12:29:53 +0100238 *
239 * \note This function works backwards in data buffer.
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100240 *
241 * \param p The reference to the current position pointer.
Hanno Becker55177552018-10-24 12:29:53 +0100242 * \param start The start of the buffer, for bounds-checking.
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100243 * \param text The string to write.
244 * \param text_len The length of \p text in bytes (which might
245 * be strictly larger than the number of characters).
246 *
247 * \return The number of bytes written to \p p on success.
248 * \return A negative error code on failure.
Jaeden Amero23f954d2018-05-17 11:46:13 +0100249 */
250int mbedtls_asn1_write_utf8_string( unsigned char **p, unsigned char *start,
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100251 const char *text, size_t text_len );
Jaeden Amero23f954d2018-05-17 11:46:13 +0100252
253/**
Hanno Becker55177552018-10-24 12:29:53 +0100254 * \brief Write a string in ASN.1 format using the IA5String
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100255 * string encoding tag (#MBEDTLS_ASN1_IA5_STRING).
Hanno Becker55177552018-10-24 12:29:53 +0100256 *
257 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200258 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100259 * \param p The reference to the current position pointer.
Hanno Becker55177552018-10-24 12:29:53 +0100260 * \param start The start of the buffer, for bounds-checking.
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100261 * \param text The string to write.
262 * \param text_len The length of \p text in bytes (which might
263 * be strictly larger than the number of characters).
Paul Bakker7accbce2013-08-26 17:34:53 +0200264 *
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100265 * \return The number of bytes written to \p p on success.
266 * \return A negative error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200267 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200268int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start,
Hanno Beckerd0e21fb2018-10-08 14:41:31 +0100269 const char *text, size_t text_len );
Paul Bakker7accbce2013-08-26 17:34:53 +0200270
271/**
Hanno Becker55177552018-10-24 12:29:53 +0100272 * \brief Write a bitstring tag (#MBEDTLS_ASN1_BIT_STRING) and
273 * value in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200274 *
Hanno Becker55177552018-10-24 12:29:53 +0100275 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200276 *
Hanno Becker55177552018-10-24 12:29:53 +0100277 * \param p The reference to the current position pointer.
278 * \param start The start of the buffer, for bounds-checking.
279 * \param buf The bitstring to write.
280 * \param bits The total number of bits in the bitstring.
281 *
282 * \return The number of bytes written to \p p on success.
283 * \return A negative error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200284 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200285int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +0100286 const unsigned char *buf, size_t bits );
Paul Bakker7accbce2013-08-26 17:34:53 +0200287
288/**
Andres Amaya Garciad8233f72018-10-08 19:44:55 +0100289 * \brief This function writes a named bitstring tag
290 * (#MBEDTLS_ASN1_BIT_STRING) and value in ASN.1 format.
Andres Amaya Garcia6e959142018-09-26 10:48:24 +0100291 *
Andres Amaya Garciad8233f72018-10-08 19:44:55 +0100292 * As stated in RFC 5280 Appendix B, trailing zeroes are
Andres Amaya Garcia6e959142018-09-26 10:48:24 +0100293 * omitted when encoding named bitstrings in DER.
294 *
Andres Amaya Garciad8233f72018-10-08 19:44:55 +0100295 * \note This function works backwards within the data buffer.
296 *
297 * \param p The reference to the current position pointer.
298 * \param start The start of the buffer which is used for bounds-checking.
299 * \param buf The bitstring to write.
Andres Amaya Garcia6e959142018-09-26 10:48:24 +0100300 * \param bits The total number of bits in the bitstring.
301 *
Andres Amaya Garciad8233f72018-10-08 19:44:55 +0100302 * \return The number of bytes written to \p p on success.
303 * \return A negative error code on failure.
Andres Amaya Garcia6e959142018-09-26 10:48:24 +0100304 */
305int mbedtls_asn1_write_named_bitstring( unsigned char **p,
306 unsigned char *start,
307 const unsigned char *buf,
308 size_t bits );
309
310/**
Hanno Becker55177552018-10-24 12:29:53 +0100311 * \brief Write an octet string tag (#MBEDTLS_ASN1_OCTET_STRING)
312 * and value in ASN.1 format.
Paul Bakker7accbce2013-08-26 17:34:53 +0200313 *
Hanno Becker55177552018-10-24 12:29:53 +0100314 * \note This function works backwards in data buffer.
Paul Bakker7accbce2013-08-26 17:34:53 +0200315 *
Hanno Becker55177552018-10-24 12:29:53 +0100316 * \param p The reference to the current position pointer.
317 * \param start The start of the buffer, for bounds-checking.
318 * \param buf The buffer holding the data to write.
319 * \param size The length of the data buffer \p buf.
320 *
321 * \return The number of bytes written to \p p on success.
322 * \return A negative error code on failure.
Paul Bakker7accbce2013-08-26 17:34:53 +0200323 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200324int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
Hanno Becker55177552018-10-24 12:29:53 +0100325 const unsigned char *buf, size_t size );
Paul Bakker59ba59f2013-09-09 11:26:00 +0200326
327/**
328 * \brief Create or find a specific named_data entry for writing in a
329 * sequence or list based on the OID. If not already in there,
330 * a new entry is added to the head of the list.
331 * Warning: Destructive behaviour for the val data!
332 *
Hanno Becker55177552018-10-24 12:29:53 +0100333 * \param list The pointer to the location of the head of the list to seek
334 * through (will be updated in case of a new entry).
335 * \param oid The OID to look for.
336 * \param oid_len The size of the OID.
Gilles Peskine09c0a232019-03-04 15:00:06 +0100337 * \param val The associated data to store. If this is \c NULL,
338 * no data is copied to the new or existing buffer.
Hanno Becker55177552018-10-24 12:29:53 +0100339 * \param val_len The minimum length of the data buffer needed.
Gilles Peskine09c0a232019-03-04 15:00:06 +0100340 * If this is 0, do not allocate a buffer for the associated
341 * data.
342 * If the OID was already present, enlarge, shrink or free
343 * the existing buffer to fit \p val_len.
Paul Bakker59ba59f2013-09-09 11:26:00 +0200344 *
Hanno Becker55177552018-10-24 12:29:53 +0100345 * \return A pointer to the new / existing entry on success.
346 * \return \c NULL if if there was a memory allocation error.
Paul Bakker59ba59f2013-09-09 11:26:00 +0200347 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200348mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list,
Paul Bakker59ba59f2013-09-09 11:26:00 +0200349 const char *oid, size_t oid_len,
350 const unsigned char *val,
351 size_t val_len );
352
Paul Bakker407a0da2013-06-27 14:29:21 +0200353#ifdef __cplusplus
354}
355#endif
356
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200357#endif /* MBEDTLS_ASN1_WRITE_H */