Home
last modified time | relevance | path

Searched refs:p (Results 1 – 25 of 139) sorted by relevance

123456

/net-tools-2.7.6/mbedtls-2.4.0/library/
Dasn1parse.c48 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()
[all …]
Dasn1write.c42 int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) in mbedtls_asn1_write_len() argument
46 if( *p - start < 1 ) in mbedtls_asn1_write_len()
49 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len()
55 if( *p - start < 2 ) in mbedtls_asn1_write_len()
58 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len()
59 *--(*p) = 0x81; in mbedtls_asn1_write_len()
65 if( *p - start < 3 ) in mbedtls_asn1_write_len()
68 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len()
69 *--(*p) = ( len >> 8 ) & 0xFF; in mbedtls_asn1_write_len()
70 *--(*p) = 0x82; in mbedtls_asn1_write_len()
[all …]
Dx509.c88 int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_serial() argument
93 if( ( end - *p ) < 1 ) in mbedtls_x509_get_serial()
97 if( **p != ( MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_PRIMITIVE | 2 ) && in mbedtls_x509_get_serial()
98 **p != MBEDTLS_ASN1_INTEGER ) in mbedtls_x509_get_serial()
102 serial->tag = *(*p)++; in mbedtls_x509_get_serial()
104 if( ( ret = mbedtls_asn1_get_len( p, end, &serial->len ) ) != 0 ) in mbedtls_x509_get_serial()
107 serial->p = *p; in mbedtls_x509_get_serial()
108 *p += serial->len; in mbedtls_x509_get_serial()
119 int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_alg_null() argument
124 if( ( ret = mbedtls_asn1_get_alg_null( p, end, alg ) ) != 0 ) in mbedtls_x509_get_alg_null()
[all …]
Dx509_crl.c71 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
77 static int x509_crl_get_version( unsigned char **p, in x509_crl_get_version() argument
83 if( ( ret = mbedtls_asn1_get_int( p, end, ver ) ) != 0 ) in x509_crl_get_version()
100 static int x509_get_crl_ext( unsigned char **p, in x509_get_crl_ext() argument
108 if( ( ret = mbedtls_x509_get_ext( p, end, ext, 0) ) != 0 ) in x509_get_crl_ext()
116 while( *p < end ) in x509_get_crl_ext()
118 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_crl_ext()
122 *p += len; in x509_get_crl_ext()
125 if( *p != end ) in x509_get_crl_ext()
135 static int x509_get_crl_entry_ext( unsigned char **p, in x509_get_crl_entry_ext() argument
[all …]
Dx509_csr.c65 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
71 static int x509_csr_get_version( unsigned char **p, in x509_csr_get_version() argument
77 if( ( ret = mbedtls_asn1_get_int( p, end, ver ) ) != 0 ) in x509_csr_get_version()
99 unsigned char *p, *end; in mbedtls_x509_csr_parse_der() local
115 p = mbedtls_calloc( 1, len = buflen ); in mbedtls_x509_csr_parse_der()
117 if( p == NULL ) in mbedtls_x509_csr_parse_der()
120 memcpy( p, buf, buflen ); in mbedtls_x509_csr_parse_der()
122 csr->raw.p = p; in mbedtls_x509_csr_parse_der()
124 end = p + len; in mbedtls_x509_csr_parse_der()
133 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_csr_parse_der()
[all …]
Dpkparse.c66 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
173 static int pk_get_ecparams( unsigned char **p, const unsigned char *end, in pk_get_ecparams() argument
179 params->tag = **p; in pk_get_ecparams()
190 if( ( ret = mbedtls_asn1_get_tag( p, end, &params->len, params->tag ) ) != 0 ) in pk_get_ecparams()
195 params->p = *p; in pk_get_ecparams()
196 *p += params->len; in pk_get_ecparams()
198 if( *p != end ) in pk_get_ecparams()
228 unsigned char *p = params->p; in pk_group_from_specified() local
229 const unsigned char * const end = params->p + params->len; in pk_group_from_specified()
235 if( ( ret = mbedtls_asn1_get_int( &p, end, &ver ) ) != 0 ) in pk_group_from_specified()
[all …]
Dx509_crt.c80 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
209 static int x509_get_version( unsigned char **p, in x509_get_version() argument
216 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_version()
228 end = *p + len; in x509_get_version()
230 if( ( ret = mbedtls_asn1_get_int( p, end, ver ) ) != 0 ) in x509_get_version()
233 if( *p != end ) in x509_get_version()
245 static int x509_get_dates( unsigned char **p, in x509_get_dates() argument
253 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_dates()
257 end = *p + len; in x509_get_dates()
259 if( ( ret = mbedtls_x509_get_time( p, end, from ) ) != 0 ) in x509_get_dates()
[all …]
Dx509_create.c177 cur->val.p[0] = critical; in mbedtls_x509_set_extension()
178 memcpy( cur->val.p + 1, val, val_len ); in mbedtls_x509_set_extension()
195 static int x509_write_name( unsigned char **p, unsigned char *start, in x509_write_name() argument
207 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_ia5_string( p, start, in x509_write_name()
213 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_printable_string( p, start, in x509_write_name()
220 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( p, start, oid, oid_len ) ); in x509_write_name()
222 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
223 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in x509_write_name()
226 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in x509_write_name()
227 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in x509_write_name()
[all …]
Dssl_cli.c53 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
62 unsigned char *p = buf; in ssl_write_hostname_ext() local
76 if( end < p || (size_t)( end - p ) < hostname_len + 9 ) in ssl_write_hostname_ext()
100 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
101 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME ) & 0xFF ); in ssl_write_hostname_ext()
103 *p++ = (unsigned char)( ( (hostname_len + 5) >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
104 *p++ = (unsigned char)( ( (hostname_len + 5) ) & 0xFF ); in ssl_write_hostname_ext()
106 *p++ = (unsigned char)( ( (hostname_len + 3) >> 8 ) & 0xFF ); in ssl_write_hostname_ext()
107 *p++ = (unsigned char)( ( (hostname_len + 3) ) & 0xFF ); in ssl_write_hostname_ext()
109 *p++ = (unsigned char)( ( MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME ) & 0xFF ); in ssl_write_hostname_ext()
[all …]
Dssl_srv.c55 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
96 const unsigned char *p; in ssl_parse_servername_ext() local
107 p = buf + 2; in ssl_parse_servername_ext()
110 hostname_len = ( ( p[1] << 8 ) | p[2] ); in ssl_parse_servername_ext()
117 if( p[0] == MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME ) in ssl_parse_servername_ext()
120 ssl, p + 3, hostname_len ); in ssl_parse_servername_ext()
132 p += hostname_len + 3; in ssl_parse_servername_ext()
194 const unsigned char *p; in ssl_parse_signature_algorithms_ext() local
214 for( p = buf + 2; p < end; p += 2 ) { in ssl_parse_signature_algorithms_ext()
215 if( *md_cur == (int) mbedtls_ssl_md_alg_from_hash( p[0] ) ) { in ssl_parse_signature_algorithms_ext()
[all …]
Dbignum.c63 volatile mbedtls_mpi_uint *p = v; while( n-- ) *p++ = 0; in mbedtls_mpi_zeroize() local
89 X->p = NULL; in mbedtls_mpi_init()
100 if( X->p != NULL ) in mbedtls_mpi_free()
102 mbedtls_mpi_zeroize( X->p, X->n ); in mbedtls_mpi_free()
103 mbedtls_free( X->p ); in mbedtls_mpi_free()
108 X->p = NULL; in mbedtls_mpi_free()
116 mbedtls_mpi_uint *p; in mbedtls_mpi_grow() local
123 if( ( p = (mbedtls_mpi_uint*)mbedtls_calloc( nblimbs, ciL ) ) == NULL ) in mbedtls_mpi_grow()
126 if( X->p != NULL ) in mbedtls_mpi_grow()
128 memcpy( p, X->p, X->n * ciL ); in mbedtls_mpi_grow()
[all …]
Decjpake.c130 ctx->s.p == NULL ) in mbedtls_ecjpake_check()
141 static int ecjpake_write_len_point( unsigned char **p, in ecjpake_write_len_point() argument
151 if( end < *p || end - *p < 5 ) in ecjpake_write_len_point()
155 &len, *p + 4, end - ( *p + 4 ) ); in ecjpake_write_len_point()
159 (*p)[0] = (unsigned char)( ( len >> 24 ) & 0xFF ); in ecjpake_write_len_point()
160 (*p)[1] = (unsigned char)( ( len >> 16 ) & 0xFF ); in ecjpake_write_len_point()
161 (*p)[2] = (unsigned char)( ( len >> 8 ) & 0xFF ); in ecjpake_write_len_point()
162 (*p)[3] = (unsigned char)( ( len ) & 0xFF ); in ecjpake_write_len_point()
164 *p += 4 + len; in ecjpake_write_len_point()
189 unsigned char *p = buf; in ecjpake_hash() local
[all …]
Drsa.c175 if( !ctx->N.p || !ctx->E.p ) in mbedtls_rsa_check_pubkey()
178 if( ( ctx->N.p[0] & 1 ) == 0 || in mbedtls_rsa_check_pubkey()
179 ( ctx->E.p[0] & 1 ) == 0 ) in mbedtls_rsa_check_pubkey()
204 if( !ctx->P.p || !ctx->Q.p || !ctx->D.p ) in mbedtls_rsa_check_privkey()
330 if( ctx->Vf.p != NULL ) in rsa_prepare_blinding()
373 if( ctx->P.p == NULL || ctx->Q.p == NULL || ctx->D.p == NULL ) in mbedtls_rsa_private()
469 unsigned char *p; in mgf_mask() local
479 p = dst; in mgf_mask()
493 *p++ ^= mask[i]; in mgf_mask()
517 unsigned char *p = output; in mbedtls_rsa_rsaes_oaep_encrypt() local
[all …]
Dbase64.c82 unsigned char *p; in mbedtls_base64_encode() local
108 for( i = 0, p = dst; i < n; i += 3 ) in mbedtls_base64_encode()
114 *p++ = base64_enc_map[(C1 >> 2) & 0x3F]; in mbedtls_base64_encode()
115 *p++ = base64_enc_map[(((C1 & 3) << 4) + (C2 >> 4)) & 0x3F]; in mbedtls_base64_encode()
116 *p++ = base64_enc_map[(((C2 & 15) << 2) + (C3 >> 6)) & 0x3F]; in mbedtls_base64_encode()
117 *p++ = base64_enc_map[C3 & 0x3F]; in mbedtls_base64_encode()
125 *p++ = base64_enc_map[(C1 >> 2) & 0x3F]; in mbedtls_base64_encode()
126 *p++ = base64_enc_map[(((C1 & 3) << 4) + (C2 >> 4)) & 0x3F]; in mbedtls_base64_encode()
129 *p++ = base64_enc_map[((C2 & 15) << 2) & 0x3F]; in mbedtls_base64_encode()
130 else *p++ = '='; in mbedtls_base64_encode()
[all …]
Dssl_cookie.c48 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
135 unsigned char **p, unsigned char *end, in ssl_cookie_hmac() argument
140 if( (size_t)( end - *p ) < COOKIE_HMAC_LEN ) in ssl_cookie_hmac()
151 memcpy( *p, hmac_out, COOKIE_HMAC_LEN ); in ssl_cookie_hmac()
152 *p += COOKIE_HMAC_LEN; in ssl_cookie_hmac()
161 unsigned char **p, unsigned char *end, in mbedtls_ssl_cookie_write() argument
171 if( (size_t)( end - *p ) < COOKIE_LEN ) in mbedtls_ssl_cookie_write()
180 (*p)[0] = (unsigned char)( t >> 24 ); in mbedtls_ssl_cookie_write()
181 (*p)[1] = (unsigned char)( t >> 16 ); in mbedtls_ssl_cookie_write()
182 (*p)[2] = (unsigned char)( t >> 8 ); in mbedtls_ssl_cookie_write()
[all …]
Dpkcs11.c175 unsigned char *p = sig; in mbedtls_pkcs11_sign() local
215 *p++ = MBEDTLS_ASN1_SEQUENCE | MBEDTLS_ASN1_CONSTRUCTED; in mbedtls_pkcs11_sign()
216 *p++ = (unsigned char) ( 0x08 + oid_size + hashlen ); in mbedtls_pkcs11_sign()
217 *p++ = MBEDTLS_ASN1_SEQUENCE | MBEDTLS_ASN1_CONSTRUCTED; in mbedtls_pkcs11_sign()
218 *p++ = (unsigned char) ( 0x04 + oid_size ); in mbedtls_pkcs11_sign()
219 *p++ = MBEDTLS_ASN1_OID; in mbedtls_pkcs11_sign()
220 *p++ = oid_size & 0xFF; in mbedtls_pkcs11_sign()
221 memcpy( p, oid, oid_size ); in mbedtls_pkcs11_sign()
222 p += oid_size; in mbedtls_pkcs11_sign()
223 *p++ = MBEDTLS_ASN1_NULL; in mbedtls_pkcs11_sign()
[all …]
Dssl_ticket.c44 volatile unsigned char *p = v; while( n-- ) *p++ = 0; in mbedtls_zeroize() local
173 unsigned char *p = buf; in ssl_save_session() local
182 memcpy( p, session, sizeof( mbedtls_ssl_session ) ); in ssl_save_session()
183 p += sizeof( mbedtls_ssl_session ); in ssl_save_session()
195 *p++ = (unsigned char)( cert_len >> 16 & 0xFF ); in ssl_save_session()
196 *p++ = (unsigned char)( cert_len >> 8 & 0xFF ); in ssl_save_session()
197 *p++ = (unsigned char)( cert_len & 0xFF ); in ssl_save_session()
200 memcpy( p, session->peer_cert->raw.p, cert_len ); in ssl_save_session()
202 p += cert_len; in ssl_save_session()
205 *olen = p - buf; in ssl_save_session()
[all …]
/net-tools-2.7.6/libcoap/src/
Duri.c46 unsigned char *p, *q; in coap_split_uri() local
56 p = str_var; in coap_split_uri()
57 if (*p == '/') { in coap_split_uri()
58 q = p; in coap_split_uri()
63 while (len && *q && tolower(*p) == *q) { in coap_split_uri()
64 ++p; ++q; --len; in coap_split_uri()
75 if (len && (secure = tolower(*p) == 's')) { in coap_split_uri()
76 ++p; --len; in coap_split_uri()
80 while (len && *q && tolower(*p) == *q) { in coap_split_uri()
81 ++p; ++q; --len; in coap_split_uri()
[all …]
/net-tools-2.7.6/mbedtls-2.4.0/programs/test/
Dudp_proxy.c149 char *p, *q; in get_options() local
159 p = argv[i]; in get_options()
160 if( ( q = strchr( p, '=' ) ) == NULL ) in get_options()
161 exit_usage( p, NULL ); in get_options()
164 if( strcmp( p, "server_addr" ) == 0 ) in get_options()
166 else if( strcmp( p, "server_port" ) == 0 ) in get_options()
168 else if( strcmp( p, "listen_addr" ) == 0 ) in get_options()
170 else if( strcmp( p, "listen_port" ) == 0 ) in get_options()
172 else if( strcmp( p, "duplicate" ) == 0 ) in get_options()
176 exit_usage( p, q ); in get_options()
[all …]
/net-tools-2.7.6/tinydtls-0.8.2/
Dnetq.c62 netq_t *p; in netq_insert_node() local
67 p = (netq_t *)list_head(queue); in netq_insert_node()
68 while(p && p->t <= node->t && list_item_next(p)) in netq_insert_node()
69 p = list_item_next(p); in netq_insert_node()
71 if (p) in netq_insert_node()
72 list_insert(queue, p, node); in netq_insert_node()
88 netq_next(netq_t *p) { in netq_next() argument
89 if (!p) in netq_next()
92 return list_item_next(p); in netq_next()
96 netq_remove(list_t queue, netq_t *p) { in netq_remove() argument
[all …]
Ddtls.c213 dtls_peer_t *p = NULL; in dtls_get_peer() local
216 HASH_FIND_PEER(ctx->peers, session, p); in dtls_get_peer()
218 for (p = list_head(ctx->peers); p; p = list_item_next(p)) in dtls_get_peer()
219 if (dtls_session_equals(&p->session, session)) in dtls_get_peer()
220 return p; in dtls_get_peer()
223 return p; in dtls_get_peer()
1185 uint8 *p, *start; in dtls_prepare_record() local
1194 p = dtls_set_record_header(type, security, sendbuf); in dtls_prepare_record()
1195 start = p; in dtls_prepare_record()
1208 memcpy(p, data_array[i], data_len_array[i]); in dtls_prepare_record()
[all …]
Ddebug.c122 char *p = buf; in dsrv_print_addr() local
136 *p++ = '['; in dsrv_print_addr()
147 if (inet_ntop(addr->addr.sa.sa_family, addrptr, p, len) == 0) { in dsrv_print_addr()
152 p += dtls_strnlen(p, len); in dsrv_print_addr()
155 if (p < buf + len) { in dsrv_print_addr()
156 *p++ = ']'; in dsrv_print_addr()
161 p += snprintf(p, buf + len - p + 1, ":%d", port); in dsrv_print_addr()
163 return p - buf; in dsrv_print_addr()
166 char *p = buf; in dsrv_print_addr()
174 *p++ = '['; in dsrv_print_addr()
[all …]
/net-tools-2.7.6/mbedtls-2.4.0/include/mbedtls/
Dasn1write.h45 int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len );
57 int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start,
71 int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
85 int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, const mbedtls_mpi *X );
97 int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start );
110 int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start,
126 int mbedtls_asn1_write_algorithm_identifier( unsigned char **p, unsigned char *start,
140 int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, int boolean );
152 int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val );
166 int mbedtls_asn1_write_printable_string( unsigned char **p, unsigned char *start,
[all …]
Dasn1.h104 memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 )
122 unsigned char *p; /**< ASN1 data, e.g. in ASCII. */ member
133 unsigned char *p; /**< Raw ASN1 data for the bit string */ member
171 int mbedtls_asn1_get_len( unsigned char **p,
187 int mbedtls_asn1_get_tag( unsigned char **p,
201 int mbedtls_asn1_get_bool( unsigned char **p,
215 int mbedtls_asn1_get_int( unsigned char **p,
229 int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end,
243 int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end,
257 int mbedtls_asn1_get_sequence_of( unsigned char **p,
[all …]
/net-tools-2.7.6/mbedtls-2.4.0/tests/suites/
Dtest_suite_asn1write.function22 unsigned char *p;
29 p = buf + GUARD_LEN + buf_len;
31 ret = mbedtls_asn1_write_octet_string( &p, buf + GUARD_LEN, str, str_len );
43 TEST_ASSERT( p + asn1_len == buf + GUARD_LEN + buf_len );
45 TEST_ASSERT( memcmp( p, asn1, asn1_len ) == 0 );
58 unsigned char *p;
65 p = buf + GUARD_LEN + buf_len;
67 ret = mbedtls_asn1_write_ia5_string( &p, buf + GUARD_LEN, str, str_len );
79 TEST_ASSERT( p + asn1_len == buf + GUARD_LEN + buf_len );
81 TEST_ASSERT( memcmp( p, asn1, asn1_len ) == 0 );
[all …]

123456