/net-tools-3.6.0/mbedtls-2.4.0/library/ |
D | asn1write.c | 42 int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, size_t len ) in mbedtls_asn1_write_len() argument 44 if( len < 0x80 ) in mbedtls_asn1_write_len() 49 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len() 53 if( len <= 0xFF ) in mbedtls_asn1_write_len() 58 *--(*p) = (unsigned char) len; in mbedtls_asn1_write_len() 63 if( len <= 0xFFFF ) in mbedtls_asn1_write_len() 68 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len() 69 *--(*p) = ( len >> 8 ) & 0xFF; in mbedtls_asn1_write_len() 74 if( len <= 0xFFFFFF ) in mbedtls_asn1_write_len() 79 *--(*p) = ( len ) & 0xFF; in mbedtls_asn1_write_len() [all …]
|
D | x509write_crt.c | 144 size_t len = 0; in mbedtls_x509write_crt_set_basic_constraints() local 155 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_int( &c, buf, max_pathlen ) ); in mbedtls_x509write_crt_set_basic_constraints() 157 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_bool( &c, buf, 1 ) ); in mbedtls_x509write_crt_set_basic_constraints() 160 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, buf, len ) ); in mbedtls_x509write_crt_set_basic_constraints() 161 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_crt_set_basic_constraints() 166 0, buf + sizeof(buf) - len, len ); in mbedtls_x509write_crt_set_basic_constraints() 175 size_t len = 0; in mbedtls_x509write_crt_set_subject_key_identifier() local 178 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_pk_write_pubkey( &c, buf, ctx->subject_key ) ); in mbedtls_x509write_crt_set_subject_key_identifier() 180 mbedtls_sha1( buf + sizeof(buf) - len, len, buf + sizeof(buf) - 20 ); in mbedtls_x509write_crt_set_subject_key_identifier() 182 len = 20; in mbedtls_x509write_crt_set_subject_key_identifier() [all …]
|
D | asn1parse.c | 56 size_t *len ) in mbedtls_asn1_get_len() argument 62 *len = *(*p)++; in mbedtls_asn1_get_len() 71 *len = (*p)[1]; in mbedtls_asn1_get_len() 79 *len = ( (size_t)(*p)[1] << 8 ) | (*p)[2]; in mbedtls_asn1_get_len() 87 *len = ( (size_t)(*p)[1] << 16 ) | in mbedtls_asn1_get_len() 96 *len = ( (size_t)(*p)[1] << 24 ) | ( (size_t)(*p)[2] << 16 ) | in mbedtls_asn1_get_len() 106 if( *len > (size_t) ( end - *p ) ) in mbedtls_asn1_get_len() 114 size_t *len, int tag ) in mbedtls_asn1_get_tag() argument 124 return( mbedtls_asn1_get_len( p, end, len ) ); in mbedtls_asn1_get_tag() 132 size_t len; in mbedtls_asn1_get_bool() local [all …]
|
D | pkwrite.c | 68 size_t len = 0; in pk_write_rsa_pubkey() local 70 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( p, start, &rsa->E ) ); in pk_write_rsa_pubkey() 71 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_mpi( p, start, &rsa->N ) ); in pk_write_rsa_pubkey() 73 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( p, start, len ) ); in pk_write_rsa_pubkey() 74 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( p, start, MBEDTLS_ASN1_CONSTRUCTED | in pk_write_rsa_pubkey() 77 return( (int) len ); in pk_write_rsa_pubkey() 89 size_t len = 0; in pk_write_ec_pubkey() local 94 &len, buf, sizeof( buf ) ) ) != 0 ) in pk_write_ec_pubkey() 99 if( *p < start || (size_t)( *p - start ) < len ) in pk_write_ec_pubkey() 102 *p -= len; in pk_write_ec_pubkey() [all …]
|
D | x509_create.c | 200 size_t len = 0; in x509_write_name() local 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() 230 return( (int) len ); in x509_write_name() 237 size_t len = 0; in mbedtls_x509_write_names() local [all …]
|
D | x509write_csr.c | 141 size_t len = 0; in mbedtls_x509write_csr_der() local 149 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_x509_write_extensions( &c, tmp_buf, ctx->extensions ) ); in mbedtls_x509write_csr_der() 151 if( len ) in mbedtls_x509write_csr_der() 153 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_csr_der() 154 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_csr_der() 157 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_csr_der() 158 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_csr_der() 161 … MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_oid( &c, tmp_buf, MBEDTLS_OID_PKCS9_CSR_EXT_REQ, in mbedtls_x509write_csr_der() 164 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_len( &c, tmp_buf, len ) ); in mbedtls_x509write_csr_der() 165 MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_tag( &c, tmp_buf, MBEDTLS_ASN1_CONSTRUCTED | in mbedtls_x509write_csr_der() [all …]
|
D | entropy_poll.c | 59 int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len, in mbedtls_platform_entropy_poll() argument 72 if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) in mbedtls_platform_entropy_poll() 79 *olen = len; in mbedtls_platform_entropy_poll() 151 unsigned char *output, size_t len, size_t *olen ) in mbedtls_platform_entropy_poll() argument 165 if( ( ret = getrandom_wrapper( output, len, 0 ) ) < 0 ) in mbedtls_platform_entropy_poll() 179 read_len = fread( output, 1, len, file ); in mbedtls_platform_entropy_poll() 180 if( read_len != len ) in mbedtls_platform_entropy_poll() 187 *olen = len; in mbedtls_platform_entropy_poll() 196 unsigned char *output, size_t len, size_t *olen ) in mbedtls_null_entropy_poll() argument 202 if( len < sizeof(unsigned char) ) in mbedtls_null_entropy_poll() [all …]
|
D | pkparse.c | 190 if( ( ret = mbedtls_asn1_get_tag( p, end, ¶ms->len, params->tag ) ) != 0 ) in pk_get_ecparams() 196 *p += params->len; in pk_get_ecparams() 229 const unsigned char * const end = params->p + params->len; in pk_group_from_specified() 231 size_t len; in pk_group_from_specified() local 247 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_group_from_specified() 251 end_field = p + len; in pk_group_from_specified() 261 if( ( ret = mbedtls_asn1_get_tag( &p, end_field, &len, MBEDTLS_ASN1_OID ) ) != 0 ) in pk_group_from_specified() 264 if( len != MBEDTLS_OID_SIZE( MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD ) || in pk_group_from_specified() 265 memcmp( p, MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD, len ) != 0 ) in pk_group_from_specified() 270 p += len; in pk_group_from_specified() [all …]
|
D | ecjpake.c | 103 size_t len ) in mbedtls_ecjpake_setup() argument 114 MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary( &ctx->s, secret, len ) ); in mbedtls_ecjpake_setup() 148 size_t len; in ecjpake_write_len_point() local 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() 316 size_t len; in ecjpake_zkp_write() local [all …]
|
D | x509_crt.c | 214 size_t len; in x509_get_version() local 216 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_version() 228 end = *p + len; in x509_get_version() 251 size_t len; in x509_get_dates() local 253 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_dates() 257 end = *p + len; in x509_get_dates() 286 if( ( ret = mbedtls_asn1_get_tag( p, end, &uid->len, in x509_get_uid() 296 *p += uid->len; in x509_get_uid() 307 size_t len; in x509_get_basic_constraints() local 317 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_basic_constraints() [all …]
|
D | x509.c | 104 if( ( ret = mbedtls_asn1_get_len( p, end, &serial->len ) ) != 0 ) in mbedtls_x509_get_serial() 108 *p += serial->len; in mbedtls_x509_get_serial() 160 size_t len; in x509_get_hash_alg() local 168 end = p + alg->len; in x509_get_hash_alg() 177 if( ( ret = mbedtls_asn1_get_tag( &p, end, &md_oid.len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_hash_alg() 181 p += md_oid.len; in x509_get_hash_alg() 191 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_NULL ) ) != 0 || len != 0 ) in x509_get_hash_alg() 220 size_t len; in mbedtls_x509_get_rsassa_pss_params() local 234 end = p + params->len; in mbedtls_x509_get_rsassa_pss_params() 242 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params() [all …]
|
D | x509_crl.c | 105 size_t len = 0; in x509_get_crl_ext() local 118 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_crl_ext() 122 *p += len; in x509_get_crl_ext() 140 size_t len = 0; in x509_get_crl_entry_ext() local 153 if( ( ret = mbedtls_asn1_get_tag( p, end, &ext->len, in x509_get_crl_entry_ext() 164 end = *p + ext->len; in x509_get_crl_entry_ext() 166 if( end != *p + ext->len ) in x509_get_crl_entry_ext() 172 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_crl_entry_ext() 176 *p += len; in x509_get_crl_entry_ext() 224 cur_entry->raw.len = len2; in x509_get_entries() [all …]
|
D | x509_csr.c | 98 size_t len; in mbedtls_x509_csr_parse_der() local 115 p = mbedtls_calloc( 1, len = buflen ); in mbedtls_x509_csr_parse_der() 123 csr->raw.len = len; 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() 140 if( len != (size_t) ( end - p ) ) in mbedtls_x509_csr_parse_der() 152 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_csr_parse_der() 159 end = p + len; in mbedtls_x509_csr_parse_der() 160 csr->cri.len = end - csr->cri.p; in mbedtls_x509_csr_parse_der() 184 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_csr_parse_der() [all …]
|
/net-tools-3.6.0/libcoap/src/ |
D | uri.c | 37 strnchr(unsigned char *s, size_t len, unsigned char c) { in strnchr() argument 38 while (len && *s++ != c) in strnchr() 39 --len; in strnchr() 41 return len ? s : NULL; in strnchr() 45 coap_split_uri(unsigned char *str_var, size_t len, coap_uri_t *uri) { in coap_split_uri() argument 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() [all …]
|
D | pdu.c | 54 LWIP_ASSERT("Can only deal with contiguous PBUFs", pbuf->tot_len == pbuf->len); in coap_pdu_from_pbuf() 153 coap_add_token(coap_pdu_t *pdu, size_t len, const unsigned char *data) { in coap_add_token() argument 154 const size_t HEADERLENGTH = len + 4; in coap_add_token() 156 if (!pdu || len > 8 || pdu->max_size < HEADERLENGTH) in coap_add_token() 159 pdu->hdr->token_length = len; in coap_add_token() 160 if (len) in coap_add_token() 161 memcpy(pdu->hdr->token, data, len); in coap_add_token() 171 coap_add_option(coap_pdu_t *pdu, unsigned short type, unsigned int len, const unsigned char *data) { in coap_add_option() argument 187 type - pdu->max_delta, data, len); in coap_add_option() 203 coap_add_option_later(coap_pdu_t *pdu, unsigned short type, unsigned int len) { in coap_add_option_later() argument [all …]
|
D | debug.c | 77 print_timestamp(char *s, size_t len, coap_tick_t t) { in print_timestamp() argument 81 return strftime(s, len, "%b %d %H:%M:%S", tmp); in print_timestamp() 87 print_timestamp(char *s, size_t len, coap_tick_t t) { in print_timestamp() argument 89 return snprintf(s, len, "%u.%03u", in print_timestamp() 121 print_readable( const unsigned char *data, unsigned int len, in print_readable() argument 125 assert(data || len == 0); in print_readable() 131 while (len) { in print_readable() 150 ++data; --len; in print_readable() 162 coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, size_t len) { in coap_print_addr() argument 174 if (len < 7) /* do not proceed if buffer is even too short for [::]:0 */ in coap_print_addr() [all …]
|
/net-tools-3.6.0/tinydtls-0.8.2/tests/ |
D | ccm-test.c | 30 dump(unsigned char *buf, size_t len) { in dump() argument 32 while (i < len) { in dump() 50 long int len; local 66 len = dtls_ccm_encrypt_message(&ctx, data[n].M, data[n].L, data[n].nonce, 71 len += + data[n].la; 73 if (len != data[n].r_lm || memcmp(data[n].msg, data[n].result, len)) 78 printf("result is (total length = %lu):\n\t", len); 79 dump(data[n].msg, len); 81 len = dtls_ccm_decrypt_message(&ctx, data[n].M, data[n].L, data[n].nonce, 82 data[n].msg + data[n].la, len - data[n].la, [all …]
|
/net-tools-3.6.0/libcoap/include/coap/ |
D | prng.h | 32 coap_prng_impl(unsigned char *buf, size_t len) { in coap_prng_impl() argument 33 while (len--) in coap_prng_impl() 48 contiki_prng_impl(unsigned char *buf, size_t len) { in contiki_prng_impl() argument 50 while (len > sizeof(v)) { in contiki_prng_impl() 52 len -= sizeof(v); in contiki_prng_impl() 57 memcpy(buf, &v, len); in contiki_prng_impl() 67 lwip_prng_impl(unsigned char *buf, size_t len) { in lwip_prng_impl() argument 69 while (len > sizeof(v)) { in lwip_prng_impl() 71 len -= sizeof(v); in lwip_prng_impl() 76 memcpy(buf, &v, len); in lwip_prng_impl()
|
/net-tools-3.6.0/tinydtls-0.8.2/ |
D | prng.h | 33 dtls_prng(unsigned char *buf, size_t len) { in dtls_prng() argument 34 while (len--) in dtls_prng() 49 dtls_prng(unsigned char *buf, size_t len) in dtls_prng() argument 51 return contiki_prng_impl(buf, len); in dtls_prng() 60 dtls_prng(unsigned char *buf, size_t len) { in dtls_prng() argument 62 while (len > sizeof(v)) { in dtls_prng() 64 len -= sizeof(v); in dtls_prng() 69 memcpy(buf, &v, len); in dtls_prng()
|
D | debug.c | 75 print_timestamp(char *s, size_t len, time_t t) { in print_timestamp() argument 78 return strftime(s, len, "%b %d %H:%M:%S", tmp); in print_timestamp() 84 print_timestamp(char *s, size_t len, clock_time_t t) { in print_timestamp() argument 86 return snprintf(s, len, "%u.%03u", in print_timestamp() 118 dsrv_print_addr(const session_t *addr, char *buf, size_t len) { in dsrv_print_addr() argument 126 if (len < INET_ADDRSTRLEN) in dsrv_print_addr() 133 if (len < INET6_ADDRSTRLEN + 2) in dsrv_print_addr() 143 memcpy(buf, "(unknown address type)", min(22, len)); in dsrv_print_addr() 144 return min(22, len); in dsrv_print_addr() 147 if (inet_ntop(addr->addr.sa.sa_family, addrptr, p, len) == 0) { in dsrv_print_addr() [all …]
|
/net-tools-3.6.0/mbedtls-2.4.0/tests/suites/ |
D | test_suite_base64.function | 16 size_t len; 22 …TEST_ASSERT( mbedtls_base64_encode( dst_str, dst_buf_size, &len, src_str, strlen( (char *) src_str… 35 size_t len; 42 …res = mbedtls_base64_decode( dst_str, sizeof( dst_str ), &len, src_str, strlen( (char *) src_str )… 56 size_t len, src_len; 61 TEST_ASSERT( mbedtls_base64_encode( res, dst_buf_size, &len, src, src_len ) == result ); 64 TEST_ASSERT( len == strlen( dst ) ); 65 TEST_ASSERT( memcmp( dst, res, len ) == 0 ); 79 size_t len, dst_len; 84 TEST_ASSERT( mbedtls_base64_decode( res, dst_buf_size, &len, (unsigned char *) src, [all …]
|
D | test_suite_hmac_drbg.function | 7 size_t len; 10 int mbedtls_entropy_func( void *data, unsigned char *buf, size_t len ) 14 if( len > ctx->len ) 17 memcpy( buf, ctx->p, len ); 19 ctx->p += len; 20 ctx->len -= len; 45 entropy.len = sizeof( buf ); 52 last_len = entropy.len; 55 TEST_ASSERT( entropy.len < last_len ); 59 last_len = entropy.len; [all …]
|
/net-tools-3.6.0/mbedtls-2.4.0/programs/ssl/ |
D | ssl_mail_client.c | 222 static int write_ssl_data( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_data() argument 227 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_data() 239 static int write_ssl_and_get_response( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ) in write_ssl_and_get_response() argument 247 while( len && ( ret = mbedtls_ssl_write( ssl, buf, len ) ) <= 0 ) in write_ssl_and_get_response() 258 len = sizeof( data ) - 1; in write_ssl_and_get_response() 260 ret = mbedtls_ssl_read( ssl, data, len ); in write_ssl_and_get_response() 275 len = ret; in write_ssl_and_get_response() 276 for( i = 0; i < len; i++ ) in write_ssl_and_get_response() 297 static int write_and_get_response( mbedtls_net_context *sock_fd, unsigned char *buf, size_t len ) in write_and_get_response() argument 305 if( len && ( ret = mbedtls_net_send( sock_fd, buf, len ) ) <= 0 ) in write_and_get_response() [all …]
|
/net-tools-3.6.0/mbedtls-2.4.0/programs/test/ |
D | udp_proxy.c | 231 static const char *msg_type( unsigned char *msg, size_t len ) in msg_type() argument 233 if( len < 1 ) return( "Invalid" ); in msg_type() 243 if( len < 13 + 12 ) return( "Invalid handshake" ); in msg_type() 296 unsigned len; member 305 ellapsed_time(), p->way, p->type, p->len ); in print_packet() 308 p->way, p->type, p->len, why ); in print_packet() 322 memcpy( buf, p->buf, p->len ); in send_packet() 323 ++buf[p->len - 1]; in send_packet() 326 if( ( ret = mbedtls_net_send( dst, buf, p->len ) ) <= 0 ) in send_packet() 334 if( ( ret = mbedtls_net_send( dst, p->buf, p->len ) ) <= 0 ) in send_packet() [all …]
|
/net-tools-3.6.0/mbedtls-2.4.0/include/mbedtls/ |
D | entropy_poll.h | 53 unsigned char *output, size_t len, size_t *olen ); 61 unsigned char *output, size_t len, size_t *olen ); 71 unsigned char *output, size_t len, size_t *olen ); 79 unsigned char *output, size_t len, size_t *olen ); 92 unsigned char *output, size_t len, size_t *olen ); 102 unsigned char *output, size_t len, size_t *olen );
|