/mbedtls-3.5.0/library/ |
D | entropy_poll.c | 93 static int getrandom_wrapper(void *buf, size_t buflen, unsigned int flags) in getrandom_wrapper() argument 98 memset(buf, 0, buflen); in getrandom_wrapper() 101 return syscall(SYS_getrandom, buf, buflen, flags); in getrandom_wrapper() 113 static int getrandom_wrapper(void *buf, size_t buflen, unsigned int flags) in getrandom_wrapper() argument 115 return getrandom(buf, buflen, flags); in getrandom_wrapper() 135 static int sysctl_arnd_wrapper(unsigned char *buf, size_t buflen) in sysctl_arnd_wrapper() argument 143 while (buflen > 0) { in sysctl_arnd_wrapper() 144 len = buflen > 256 ? 256 : buflen; in sysctl_arnd_wrapper() 148 buflen -= len; in sysctl_arnd_wrapper()
|
D | error.c | 789 void mbedtls_strerror(int ret, char *buf, size_t buflen) in mbedtls_strerror() argument 796 if (buflen == 0) { in mbedtls_strerror() 800 memset(buf, 0x00, buflen); in mbedtls_strerror() 813 mbedtls_snprintf(buf, buflen, "UNKNOWN ERROR CODE (%04X)", (unsigned int) use_ret); in mbedtls_strerror() 815 mbedtls_snprintf(buf, buflen, "%s", high_level_error_description); in mbedtls_strerror() 839 if (buflen - len < 5) { in mbedtls_strerror() 843 mbedtls_snprintf(buf + len, buflen - len, " : "); in mbedtls_strerror() 846 buflen -= len + 3; in mbedtls_strerror() 853 mbedtls_snprintf(buf, buflen, "UNKNOWN ERROR CODE (%04X)", (unsigned int) use_ret); in mbedtls_strerror() 855 mbedtls_snprintf(buf, buflen, "%s", low_level_error_description); in mbedtls_strerror() [all …]
|
D | x509_crl.c | 295 const unsigned char *buf, size_t buflen) in mbedtls_x509_crl_parse_der() argument 336 if (buflen == 0) { in mbedtls_x509_crl_parse_der() 340 p = mbedtls_calloc(1, buflen); in mbedtls_x509_crl_parse_der() 345 memcpy(p, buf, buflen); in mbedtls_x509_crl_parse_der() 348 crl->raw.len = buflen; in mbedtls_x509_crl_parse_der() 350 end = p + buflen; in mbedtls_x509_crl_parse_der() 516 int mbedtls_x509_crl_parse(mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen) in mbedtls_x509_crl_parse() argument 533 if (buflen == 0 || buf[buflen - 1] != '\0') { in mbedtls_x509_crl_parse() 548 buflen -= use_len; in mbedtls_x509_crl_parse() 552 pem.buf, pem.buflen)) != 0) { in mbedtls_x509_crl_parse() [all …]
|
D | x509_csr.c | 235 const unsigned char *buf, size_t buflen) in mbedtls_x509_csr_parse_der() argument 247 if (csr == NULL || buf == NULL || buflen == 0) { in mbedtls_x509_csr_parse_der() 256 p = mbedtls_calloc(1, len = buflen); in mbedtls_x509_csr_parse_der() 262 memcpy(p, buf, buflen); in mbedtls_x509_csr_parse_der() 401 int mbedtls_x509_csr_parse(mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen) in mbedtls_x509_csr_parse() argument 412 if (csr == NULL || buf == NULL || buflen == 0) { in mbedtls_x509_csr_parse() 418 if (buf[buflen - 1] == '\0') { in mbedtls_x509_csr_parse() 435 ret = mbedtls_x509_csr_parse_der(csr, pem.buf, pem.buflen); in mbedtls_x509_csr_parse() 444 return mbedtls_x509_csr_parse_der(csr, buf, buflen); in mbedtls_x509_csr_parse()
|
D | x509write_csr.c | 97 size_t buflen = 0; in mbedtls_x509write_csr_set_subject_alternative_name() local 110 buflen += cur->node.san.unstructured_name.len + 4 + 1; in mbedtls_x509write_csr_set_subject_alternative_name() 120 buflen += 4 + 1; in mbedtls_x509write_csr_set_subject_alternative_name() 123 buf = mbedtls_calloc(1, buflen); in mbedtls_x509write_csr_set_subject_alternative_name() 128 mbedtls_platform_zeroize(buf, buflen); in mbedtls_x509write_csr_set_subject_alternative_name() 129 p = buf + buflen; in mbedtls_x509write_csr_set_subject_alternative_name() 174 buf + buflen - len, in mbedtls_x509write_csr_set_subject_alternative_name()
|
D | pem.c | 262 unsigned char *buf, size_t buflen, in pem_des_decrypt() argument 278 ret = mbedtls_des_crypt_cbc(&des_ctx, MBEDTLS_DES_DECRYPT, buflen, in pem_des_decrypt() 292 unsigned char *buf, size_t buflen, in pem_des3_decrypt() argument 308 ret = mbedtls_des3_crypt_cbc(&des3_ctx, MBEDTLS_DES_DECRYPT, buflen, in pem_des3_decrypt() 324 unsigned char *buf, size_t buflen, in pem_aes_decrypt() argument 340 ret = mbedtls_aes_crypt_cbc(&aes_ctx, MBEDTLS_AES_DECRYPT, buflen, in pem_aes_decrypt() 562 ctx->buflen = len; in mbedtls_pem_read_buffer() 570 mbedtls_platform_zeroize(ctx->buf, ctx->buflen); in mbedtls_pem_free()
|
D | mps_reader.c | 232 mbedtls_mps_size_t *buflen) in mbedtls_mps_reader_get() argument 339 if (buflen != NULL) { in mbedtls_mps_reader_get() 340 *buflen = desired; in mbedtls_mps_reader_get() 367 if (buflen == NULL) { in mbedtls_mps_reader_get() 387 if (buflen != NULL) { in mbedtls_mps_reader_get() 388 *buflen = desired; in mbedtls_mps_reader_get()
|
D | pkcs7.c | 463 static int pkcs7_get_signed_data(unsigned char *buf, size_t buflen, in pkcs7_get_signed_data() argument 467 unsigned char *end = buf + buflen; in pkcs7_get_signed_data() 566 const size_t buflen) in mbedtls_pkcs7_parse_der() argument 578 pkcs7->raw.p = p = mbedtls_calloc(1, buflen); in mbedtls_pkcs7_parse_der() 583 memcpy(p, buf, buflen); in mbedtls_pkcs7_parse_der() 584 pkcs7->raw.len = buflen; in mbedtls_pkcs7_parse_der() 585 end = p + buflen; in mbedtls_pkcs7_parse_der() 605 len = buflen; in mbedtls_pkcs7_parse_der()
|
D | mps_reader.h | 294 mbedtls_mps_size_t buflen); 357 mbedtls_mps_size_t *buflen);
|
D | x509_crt.c | 957 size_t buflen, in x509_crt_parse_der_core() argument 980 len = buflen; in x509_crt_parse_der_core() 1197 size_t buflen, in mbedtls_x509_crt_parse_der_internal() argument 1232 ret = x509_crt_parse_der_core(crt, buf, buflen, make_copy, cb, p_ctx); in mbedtls_x509_crt_parse_der_internal() 1250 size_t buflen) in mbedtls_x509_crt_parse_der_nocopy() argument 1252 return mbedtls_x509_crt_parse_der_internal(chain, buf, buflen, 0, NULL, NULL); in mbedtls_x509_crt_parse_der_nocopy() 1257 size_t buflen, in mbedtls_x509_crt_parse_der_with_ext_cb() argument 1262 return mbedtls_x509_crt_parse_der_internal(chain, buf, buflen, make_copy, cb, p_ctx); in mbedtls_x509_crt_parse_der_with_ext_cb() 1267 size_t buflen) in mbedtls_x509_crt_parse_der() argument 1269 return mbedtls_x509_crt_parse_der_internal(chain, buf, buflen, 1, NULL, NULL); in mbedtls_x509_crt_parse_der() [all …]
|
D | bignum.c | 457 char **p, const size_t buflen) in mpi_write_hlp() argument 462 char *p_end = *p + buflen; in mpi_write_hlp() 465 if (length >= buflen) { in mpi_write_hlp() 495 char *buf, size_t buflen, size_t *olen) in mbedtls_mpi_write_string() argument 503 MPI_VALIDATE_RET(buflen == 0 || buf != NULL); in mbedtls_mpi_write_string() 528 if (buflen < n) { in mbedtls_mpi_write_string() 538 buflen--; in mbedtls_mpi_write_string() 565 MBEDTLS_MPI_CHK(mpi_write_hlp(&T, radix, &p, buflen)); in mbedtls_mpi_write_string() 680 const unsigned char *buf, size_t buflen) in mbedtls_mpi_read_binary_le() argument 683 const size_t limbs = CHARS_TO_LIMBS(buflen); in mbedtls_mpi_read_binary_le() [all …]
|
D | bignum_mod.h | 427 size_t buflen, 465 size_t buflen,
|
D | bignum_mod.c | 354 size_t buflen, in mbedtls_mpi_mod_read() argument 367 ret = mbedtls_mpi_mod_raw_read(r->p, N, buf, buflen, ext_rep); in mbedtls_mpi_mod_read() 383 size_t buflen, in mbedtls_mpi_mod_write() argument 403 ret = mbedtls_mpi_mod_raw_write(r->p, N, buf, buflen, ext_rep); in mbedtls_mpi_mod_write()
|
/mbedtls-3.5.0/scripts/data_files/ |
D | error.fmt | 81 void mbedtls_strerror(int ret, char *buf, size_t buflen) 88 if (buflen == 0) { 92 memset(buf, 0x00, buflen); 105 mbedtls_snprintf(buf, buflen, "UNKNOWN ERROR CODE (%04X)", (unsigned int) use_ret); 107 mbedtls_snprintf(buf, buflen, "%s", high_level_error_description); 131 if (buflen - len < 5) { 135 mbedtls_snprintf(buf + len, buflen - len, " : "); 138 buflen -= len + 3; 145 mbedtls_snprintf(buf, buflen, "UNKNOWN ERROR CODE (%04X)", (unsigned int) use_ret); 147 mbedtls_snprintf(buf, buflen, "%s", low_level_error_description); [all …]
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_pkcs7.function | 18 int pkcs7_parse_buffer(unsigned char *pkcs7_buf, int buflen) 24 res = mbedtls_pkcs7_parse_der(&pkcs7, pkcs7_buf, buflen); 44 size_t buflen; 47 res = mbedtls_pk_load_file(pkcs7_file, &pkcs7_buf, &buflen); 50 res = pkcs7_parse_buffer(pkcs7_buf, buflen); 66 size_t buflen, i, k, cnt = 0, n_crts = 1; 109 res = mbedtls_pk_load_file(pkcs7_file, &pkcs7_buf, &buflen); 112 res = mbedtls_pkcs7_parse_der(&pkcs7, pkcs7_buf, buflen); 131 buflen = fread((void *) data, sizeof(unsigned char), datalen, file); 132 TEST_EQUAL(buflen, datalen);
|
D | test_suite_shax.function | 26 size_t const buflen = sizeof(buf); 33 mbedtls_sha256(buf, buflen, 74 size_t const buflen = sizeof(buf); 81 mbedtls_sha512(buf, buflen,
|
D | test_suite_bignum.function | 192 size_t buflen; 200 buflen = mbedtls_mpi_size(&X); 201 if (buflen > (size_t) output_size) { 202 buflen = (size_t) output_size; 205 TEST_ASSERT(mbedtls_mpi_write_binary(&X, buf, buflen) == result); 209 buflen, input_A->len) == 0); 223 size_t buflen; 231 buflen = mbedtls_mpi_size(&X); 232 if (buflen > (size_t) output_size) { 233 buflen = (size_t) output_size; [all …]
|
/mbedtls-3.5.0/include/mbedtls/ |
D | pem.h | 66 size_t MBEDTLS_PRIVATE(buflen); /*!< length of the buffer */ 121 static inline const unsigned char *mbedtls_pem_get_buffer(mbedtls_pem_context *ctx, size_t *buflen) in mbedtls_pem_get_buffer() argument 123 *buflen = ctx->MBEDTLS_PRIVATE(buflen); in mbedtls_pem_get_buffer()
|
D | bignum.h | 482 char *buf, size_t buflen, size_t *olen); 540 size_t buflen); 555 const unsigned char *buf, size_t buflen); 573 size_t buflen); 591 unsigned char *buf, size_t buflen);
|
D | x509_crl.h | 122 const unsigned char *buf, size_t buflen); 139 int mbedtls_x509_crl_parse(mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen);
|
D | x509_crt.h | 366 size_t buflen); 451 size_t buflen, 489 size_t buflen); 525 int mbedtls_x509_crt_parse(mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen);
|
D | x509_csr.h | 109 const unsigned char *buf, size_t buflen); 127 int mbedtls_x509_csr_parse(mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen);
|
D | ecp.h | 772 unsigned char *buf, size_t buflen); 1258 const unsigned char *buf, size_t buflen); 1277 unsigned char *buf, size_t buflen);
|
/mbedtls-3.5.0/programs/pkey/ |
D | dh_server.c | 66 size_t n, buflen; in main() local 213 buflen = n + 2 + rsa.MBEDTLS_PRIVATE(len); in main() 214 buf2[0] = (unsigned char) (buflen >> 8); in main() 215 buf2[1] = (unsigned char) (buflen); in main() 218 (ret = mbedtls_net_send(&client_fd, buf, buflen)) != (int) buflen) { in main()
|
D | dh_client.c | 66 size_t n, buflen; in main() local 150 n = buflen = (buf[0] << 8) | buf[1]; in main() 151 if (buflen < 1 || buflen > sizeof(buf)) { in main() 166 p = buf, end = buf + buflen; in main()
|