Lines Matching refs:p
48 volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
54 int mbedtls_asn1_get_len( unsigned char **p, in mbedtls_asn1_get_len() argument
58 if( ( end - *p ) < 1 ) in mbedtls_asn1_get_len()
61 if( ( **p & 0x80 ) == 0 ) in mbedtls_asn1_get_len()
62 *len = *(*p)++; in mbedtls_asn1_get_len()
65 switch( **p & 0x7F ) in mbedtls_asn1_get_len()
68 if( ( end - *p ) < 2 ) in mbedtls_asn1_get_len()
71 *len = (*p)[1]; in mbedtls_asn1_get_len()
72 (*p) += 2; in mbedtls_asn1_get_len()
76 if( ( end - *p ) < 3 ) in mbedtls_asn1_get_len()
79 *len = ( (size_t)(*p)[1] << 8 ) | (*p)[2]; in mbedtls_asn1_get_len()
80 (*p) += 3; in mbedtls_asn1_get_len()
84 if( ( end - *p ) < 4 ) in mbedtls_asn1_get_len()
87 *len = ( (size_t)(*p)[1] << 16 ) | in mbedtls_asn1_get_len()
88 ( (size_t)(*p)[2] << 8 ) | (*p)[3]; in mbedtls_asn1_get_len()
89 (*p) += 4; in mbedtls_asn1_get_len()
93 if( ( end - *p ) < 5 ) in mbedtls_asn1_get_len()
96 *len = ( (size_t)(*p)[1] << 24 ) | ( (size_t)(*p)[2] << 16 ) | in mbedtls_asn1_get_len()
97 ( (size_t)(*p)[3] << 8 ) | (*p)[4]; in mbedtls_asn1_get_len()
98 (*p) += 5; in mbedtls_asn1_get_len()
106 if( *len > (size_t) ( end - *p ) ) in mbedtls_asn1_get_len()
112 int mbedtls_asn1_get_tag( unsigned char **p, in mbedtls_asn1_get_tag() argument
116 if( ( end - *p ) < 1 ) in mbedtls_asn1_get_tag()
119 if( **p != tag ) in mbedtls_asn1_get_tag()
122 (*p)++; in mbedtls_asn1_get_tag()
124 return( mbedtls_asn1_get_len( p, end, len ) ); in mbedtls_asn1_get_tag()
127 int mbedtls_asn1_get_bool( unsigned char **p, in mbedtls_asn1_get_bool() argument
134 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_BOOLEAN ) ) != 0 ) in mbedtls_asn1_get_bool()
140 *val = ( **p != 0 ) ? 1 : 0; in mbedtls_asn1_get_bool()
141 (*p)++; in mbedtls_asn1_get_bool()
146 int mbedtls_asn1_get_int( unsigned char **p, in mbedtls_asn1_get_int() argument
153 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_INTEGER ) ) != 0 ) in mbedtls_asn1_get_int()
156 if( len == 0 || len > sizeof( int ) || ( **p & 0x80 ) != 0 ) in mbedtls_asn1_get_int()
163 *val = ( *val << 8 ) | **p; in mbedtls_asn1_get_int()
164 (*p)++; in mbedtls_asn1_get_int()
171 int mbedtls_asn1_get_mpi( unsigned char **p, in mbedtls_asn1_get_mpi() argument
178 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, MBEDTLS_ASN1_INTEGER ) ) != 0 ) in mbedtls_asn1_get_mpi()
181 ret = mbedtls_mpi_read_binary( X, *p, len ); in mbedtls_asn1_get_mpi()
183 *p += len; in mbedtls_asn1_get_mpi()
189 int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end, in mbedtls_asn1_get_bitstring() argument
195 if( ( ret = mbedtls_asn1_get_tag( p, end, &bs->len, MBEDTLS_ASN1_BIT_STRING ) ) != 0 ) in mbedtls_asn1_get_bitstring()
204 bs->unused_bits = **p; in mbedtls_asn1_get_bitstring()
207 (*p)++; in mbedtls_asn1_get_bitstring()
210 bs->p = *p; in mbedtls_asn1_get_bitstring()
211 *p += bs->len; in mbedtls_asn1_get_bitstring()
213 if( *p != end ) in mbedtls_asn1_get_bitstring()
222 int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end, in mbedtls_asn1_get_bitstring_null() argument
227 if( ( ret = mbedtls_asn1_get_tag( p, end, len, MBEDTLS_ASN1_BIT_STRING ) ) != 0 ) in mbedtls_asn1_get_bitstring_null()
230 if( (*len)-- < 2 || *(*p)++ != 0 ) in mbedtls_asn1_get_bitstring_null()
241 int mbedtls_asn1_get_sequence_of( unsigned char **p, in mbedtls_asn1_get_sequence_of() argument
251 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_asn1_get_sequence_of()
255 if( *p + len != end ) in mbedtls_asn1_get_sequence_of()
258 while( *p < end ) in mbedtls_asn1_get_sequence_of()
261 buf->tag = **p; in mbedtls_asn1_get_sequence_of()
263 if( ( ret = mbedtls_asn1_get_tag( p, end, &buf->len, tag ) ) != 0 ) in mbedtls_asn1_get_sequence_of()
266 buf->p = *p; in mbedtls_asn1_get_sequence_of()
267 *p += buf->len; in mbedtls_asn1_get_sequence_of()
270 if( *p < end ) in mbedtls_asn1_get_sequence_of()
285 if( *p != end ) in mbedtls_asn1_get_sequence_of()
291 int mbedtls_asn1_get_alg( unsigned char **p, in mbedtls_asn1_get_alg() argument
298 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_asn1_get_alg()
302 if( ( end - *p ) < 1 ) in mbedtls_asn1_get_alg()
305 alg->tag = **p; in mbedtls_asn1_get_alg()
306 end = *p + len; in mbedtls_asn1_get_alg()
308 if( ( ret = mbedtls_asn1_get_tag( p, end, &alg->len, MBEDTLS_ASN1_OID ) ) != 0 ) in mbedtls_asn1_get_alg()
311 alg->p = *p; in mbedtls_asn1_get_alg()
312 *p += alg->len; in mbedtls_asn1_get_alg()
314 if( *p == end ) in mbedtls_asn1_get_alg()
320 params->tag = **p; in mbedtls_asn1_get_alg()
321 (*p)++; in mbedtls_asn1_get_alg()
323 if( ( ret = mbedtls_asn1_get_len( p, end, ¶ms->len ) ) != 0 ) in mbedtls_asn1_get_alg()
326 params->p = *p; in mbedtls_asn1_get_alg()
327 *p += params->len; in mbedtls_asn1_get_alg()
329 if( *p != end ) in mbedtls_asn1_get_alg()
335 int mbedtls_asn1_get_alg_null( unsigned char **p, in mbedtls_asn1_get_alg_null() argument
344 if( ( ret = mbedtls_asn1_get_alg( p, end, alg, ¶ms ) ) != 0 ) in mbedtls_asn1_get_alg_null()
358 mbedtls_free( cur->oid.p ); in mbedtls_asn1_free_named_data()
359 mbedtls_free( cur->val.p ); in mbedtls_asn1_free_named_data()
382 memcmp( list->oid.p, oid, len ) == 0 ) in mbedtls_asn1_find_named_data()