/mbedtls-latest/tests/suites/ |
D | test_suite_ccm.data | 29 CCM lengths #4 tag too short 32 CCM lengths #5 tag too long 35 CCM lengths #6 tag length not even 45 CCM lengths #9 tag length 0 51 CCM* fixed tag lengths #1 all OK 54 CCM* fixed tag lengths #2 all OK - tag length 0 57 CCM* encrypt and tag #1 61 CCM* encrypt and tag #2 65 CCM* encrypt and tag #3 69 CCM* auth decrypt tag #1 [all …]
|
D | test_suite_pkcs7.data | 49 PKCS7 Signed Data Parse Fail with corrupted signer info[1] unexpected tag #6.3 53 PKCS7 Signed Data Parse Fail with corrupted signer info[2] unexpected tag #6.4 165 PKCS7 Parse Failure Invalid ASN1: Change tag 30 to 02 #22.0 173 PKCS7 Parse Failure Invalid ASN1: Change contents of tag 30 to contain one unaccounted extra byte #… 177 PKCS7 Parse Failure Invalid ASN1: Change tag 06 to 02 #25.0 189 PKCS7 Parse Failure Invalid ASN1: Change tag a0 to 02 #28.0 197 PKCS7 Parse Failure Invalid ASN1: Change contents of tag a0 to contain one unaccounted extra byte #… 205 PKCS7 Parse Failure Invalid ASN1: Change tag 30 to 02 #32.0 213 PKCS7 Parse Failure Invalid ASN1: Change contents of tag 30 to contain one unaccounted extra byte #… 221 PKCS7 Parse Failure Invalid ASN1: Change tag 02 to 04 #36.0 [all …]
|
D | test_suite_ccm.function | 13 const data_t *tag, 28 TEST_EQUAL(0, mbedtls_ccm_set_lengths(ctx, add->len, input->len, tag->len)); 51 TEST_CALLOC(output, tag->len); 52 TEST_EQUAL(0, mbedtls_ccm_finish(ctx, output, tag->len)); 53 TEST_MEMORY_COMPARE(output, tag->len, tag->x, tag->len); 109 unsigned char tag[18]; 120 memset(tag, 0, sizeof(tag)); 126 msg, out, tag, tag_len) == res); 129 msg, out, tag, tag_len); 154 unsigned char tag[18]; [all …]
|
D | test_suite_gcm.function | 13 const data_t *tag, 52 TEST_CALLOC(output, tag->len); 53 TEST_EQUAL(0, mbedtls_gcm_finish(ctx, NULL, 0, &olen, output, tag->len)); 55 TEST_MEMORY_COMPARE(output, tag->len, tag->x, tag->len); 70 const data_t *tag, 98 TEST_CALLOC(output, tag->len); 99 TEST_EQUAL(0, mbedtls_gcm_finish(ctx, NULL, 0, &olen, output, tag->len)); 101 TEST_MEMORY_COMPARE(output, tag->len, tag->x, tag->len); 111 const data_t *tag, 127 TEST_CALLOC(output_tag, tag->len); [all …]
|
D | test_suite_asn1parse.function | 27 unsigned char tag; 29 /* First get the length, skipping over the tag. */ 37 /* Since we have a valid element start (tag and length), retrieve and 38 * check the tag. */ 39 tag = start[0]; 40 TEST_EQUAL(mbedtls_asn1_get_tag(p, end, &len2, tag ^ 1), 43 TEST_EQUAL(mbedtls_asn1_get_tag(p, end, &len2, tag), 0); 48 switch (tag & 0x1f) { 113 /* No further testing implemented for this tag. */ 182 static int traverse_callback(void *ctx, int tag, [all …]
|
D | test_suite_cipher.function | 372 unsigned char tag[16]; 422 memset(tag, 0, sizeof(tag)); 465 TEST_EQUAL(expected, mbedtls_cipher_write_tag(&ctx_enc, tag, sizeof(tag))); 486 TEST_EQUAL(expected, mbedtls_cipher_check_tag(&ctx_dec, tag, sizeof(tag))); 790 data_t *clear, data_t *ad, data_t *tag, 803 ((void) tag); 827 /* decode buffer and check tag->x */ 843 TEST_EQUAL(tag_expected, mbedtls_cipher_check_tag(&ctx, tag->x, tag->len)); 859 data_t *ad, data_t *cipher, data_t *tag, 863 * Take an AEAD ciphertext + tag and perform a pair [all …]
|
D | test_suite_oid.function | 20 asn1_buf.tag = MBEDTLS_ASN1_OID; 41 asn1_buf.tag = MBEDTLS_ASN1_OID; 62 ext_oid.tag = MBEDTLS_ASN1_OID; 83 md_oid.tag = MBEDTLS_ASN1_OID; 106 md_oid.tag = MBEDTLS_ASN1_OID; 129 input_oid.tag = MBEDTLS_ASN1_OID; 154 exp_oid.tag = MBEDTLS_ASN1_OID;
|
D | test_suite_x509write.function | 87 * - 1 byte for MBEDTLS_ASN1_OID tag 361 unsigned char tag, sz; 509 x.tag = MBEDTLS_ASN1_OID; \ 581 // UTC tag if before 2050, 2 digits less for year 596 tag = *p++; 598 if (tag == MBEDTLS_ASN1_UTC_TIME || tag == MBEDTLS_ASN1_GENERALIZED_TIME) { 599 // Check correct tag and time written 600 TEST_ASSERT(before_tag == tag); 603 tag = *p++; 605 TEST_ASSERT(after_tag == tag); [all …]
|
D | test_suite_pkcs12.function | 89 pbe_params.tag = params_tag; 107 pbe_params.tag = params_tag; 144 pbe_params.tag = params_tag; 163 pbe_params.tag = params_tag;
|
D | test_suite_x509parse.function | 330 if (oid->tag == MBEDTLS_ASN1_OID && 337 /* Get main sequence tag */ 413 } else if (new_oid != NULL && new_oid->tag == oid->tag && new_oid->len == oid->len && 1210 oid.tag = MBEDTLS_ASN1_OID; 1512 oid.tag = MBEDTLS_ASN1_OID; 1542 oid.tag = MBEDTLS_ASN1_OID; 1599 void x509_get_time(int tag, char *time_str, int ret, int year, int mon, 1609 *end = (unsigned char) tag; end++; 1644 buf.tag = params_tag; 1672 TEST_EQUAL(crt.subject_key_id.tag, MBEDTLS_ASN1_OCTET_STRING); [all …]
|
/mbedtls-latest/library/ |
D | asn1parse.c | 63 size_t *len, int tag) in mbedtls_asn1_get_tag() argument 69 if (**p != tag) { in mbedtls_asn1_get_tag() 103 int tag, int *val) in asn1_get_tagged_int() argument 108 if ((ret = mbedtls_asn1_get_tag(p, end, &len, tag)) != 0) { in asn1_get_tagged_int() 225 int (*cb)(void *ctx, int tag, in mbedtls_asn1_traverse_sequence_of() argument 243 unsigned char const tag = *(*p)++; in mbedtls_asn1_traverse_sequence_of() local 245 if ((tag & tag_must_mask) != tag_must_val) { in mbedtls_asn1_traverse_sequence_of() 253 if ((tag & tag_may_mask) == tag_may_val) { in mbedtls_asn1_traverse_sequence_of() 255 ret = cb(ctx, tag, *p, len); in mbedtls_asn1_traverse_sequence_of() 303 int tag; member [all …]
|
D | psa_crypto_aead.c | 128 uint8_t *tag; in mbedtls_psa_aead_encrypt() local 143 tag = ciphertext + plaintext_length; in mbedtls_psa_aead_encrypt() 154 tag, operation.tag_length)); in mbedtls_psa_aead_encrypt() 166 operation.tag_length, tag)); in mbedtls_psa_aead_encrypt() 183 tag)); in mbedtls_psa_aead_encrypt() 187 (void) tag; in mbedtls_psa_aead_encrypt() 240 const uint8_t *tag = NULL; in mbedtls_psa_aead_decrypt() local 251 plaintext_size, &tag); in mbedtls_psa_aead_decrypt() 265 tag, operation.tag_length)); in mbedtls_psa_aead_decrypt() 276 tag, operation.tag_length, in mbedtls_psa_aead_decrypt() [all …]
|
D | x509.c | 79 serial->tag = *(*p)++; in mbedtls_x509_get_serial() 188 if (alg->tag != (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) { in x509_get_hash_alg() 202 md_oid.tag = *p; in x509_get_hash_alg() 261 if (params->tag != (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE)) { in mbedtls_x509_get_rsassa_pss_params() 428 oid->tag = **p; in x509_get_attr_type_value() 451 val->tag = *(*p)++; in x509_get_attr_type_value() 654 unsigned char tag; in mbedtls_x509_get_time() local 661 tag = **p; in mbedtls_x509_get_time() 663 if (tag == MBEDTLS_ASN1_UTC_TIME) { in mbedtls_x509_get_time() 665 } else if (tag == MBEDTLS_ASN1_GENERALIZED_TIME) { in mbedtls_x509_get_time() [all …]
|
D | ccm.c | 473 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument 501 if (tag != NULL) { in mbedtls_ccm_finish() 502 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish() 516 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument 538 if ((ret = mbedtls_ccm_finish(ctx, tag, tag_len)) != 0) { in ccm_auth_crypt() 552 unsigned char *tag, size_t tag_len) in mbedtls_ccm_star_encrypt_and_tag() argument 555 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_star_encrypt_and_tag() 562 unsigned char *tag, size_t tag_len) in mbedtls_ccm_encrypt_and_tag() argument 565 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_encrypt_and_tag() 589 const unsigned char *tag, size_t tag_len) in ccm_auth_decrypt() argument [all …]
|
D | x509_create.c | 207 int *tag) in parse_attribute_value_hex_der_encoded() argument 244 *tag = der[0]; in parse_attribute_value_hex_der_encoded() 258 if (MBEDTLS_ASN1_IS_STRING_TAG(*tag)) { in parse_attribute_value_hex_der_encoded() 287 mbedtls_asn1_buf oid = { .p = NULL, .len = 0, .tag = MBEDTLS_ASN1_NULL }; in mbedtls_x509_string_to_names() 290 int tag; in mbedtls_x509_string_to_names() local 326 data, sizeof(data), &data_len, &tag); in mbedtls_x509_string_to_names() 342 tag = attr_descr->default_tag; in mbedtls_x509_string_to_names() 357 cur->val.tag = tag; in mbedtls_x509_string_to_names() 425 cur_name->val.tag, in x509_write_name()
|
D | asn1write.c | 56 int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsigned char tag) in mbedtls_asn1_write_tag() argument 62 *--(*p) = tag; in mbedtls_asn1_write_tag() 72 unsigned char tag) in mbedtls_asn1_write_len_and_tag() argument 77 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(p, start, tag)); in mbedtls_asn1_write_len_and_tag() 200 static int asn1_write_tagged_int(unsigned char **p, const unsigned char *start, int val, int tag) in asn1_write_tagged_int() argument 221 return mbedtls_asn1_write_len_and_tag(p, start, len, tag); in asn1_write_tagged_int() 234 int mbedtls_asn1_write_tagged_string(unsigned char **p, const unsigned char *start, int tag, in mbedtls_asn1_write_tagged_string() argument 244 return mbedtls_asn1_write_len_and_tag(p, start, len, tag); in mbedtls_asn1_write_tagged_string()
|
D | cipher.c | 1183 unsigned char *tag, size_t tag_len) in mbedtls_cipher_write_tag() argument 1209 tag, tag_len); in mbedtls_cipher_write_tag() 1221 (mbedtls_chachapoly_context *) ctx->cipher_ctx, tag); in mbedtls_cipher_write_tag() 1229 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument 1272 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1293 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag() 1410 unsigned char *tag, size_t tag_len) in mbedtls_cipher_aead_encrypt() argument 1426 if (output == NULL || tag != output + ilen) { in mbedtls_cipher_aead_encrypt() 1450 input, output, tag_len, tag); in mbedtls_cipher_aead_encrypt() 1458 tag, tag_len); in mbedtls_cipher_aead_encrypt() [all …]
|
D | chachapoly.c | 252 unsigned char tag[16]) in chachapoly_crypt_and_tag() 271 ret = mbedtls_chachapoly_finish(ctx, tag); in chachapoly_crypt_and_tag() 284 unsigned char tag[16]) in mbedtls_chachapoly_encrypt_and_tag() 288 input, output, tag); in mbedtls_chachapoly_encrypt_and_tag() 296 const unsigned char tag[16], in mbedtls_chachapoly_auth_decrypt() 311 diff = mbedtls_ct_memcmp(tag, check_tag, sizeof(check_tag)); in mbedtls_chachapoly_auth_decrypt()
|
D | pkparse.c | 66 static int pk_ecc_tag_is_specified_ec_domain(int tag) in pk_ecc_tag_is_specified_ec_domain() argument 68 (void) tag; in pk_ecc_tag_is_specified_ec_domain() 85 static int pk_ecc_tag_is_specified_ec_domain(int tag) in pk_ecc_tag_is_specified_ec_domain() argument 87 return tag == (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); in pk_ecc_tag_is_specified_ec_domain() 359 params->tag = **p; in pk_get_ecparams() 360 if (params->tag != MBEDTLS_ASN1_OID && in pk_get_ecparams() 361 !pk_ecc_tag_is_specified_ec_domain(params->tag)) { in pk_get_ecparams() 366 if ((ret = mbedtls_asn1_get_tag(p, end, ¶ms->len, params->tag)) != 0) { in pk_get_ecparams() 394 if (params->tag == MBEDTLS_ASN1_OID) { in pk_use_ecparams() 417 if (params->tag != 0 || params->len != 0) { in pk_use_ecparams_rfc8410() [all …]
|
D | x509_crt.c | 313 if (a->tag == b->tag && in x509_string_cmp() 319 if ((a->tag == MBEDTLS_ASN1_UTF8_STRING || a->tag == MBEDTLS_ASN1_PRINTABLE_STRING) && in x509_string_cmp() 320 (b->tag == MBEDTLS_ASN1_UTF8_STRING || b->tag == MBEDTLS_ASN1_PRINTABLE_STRING) && in x509_string_cmp() 348 if (a->oid.tag != b->oid.tag || in x509_name_cmp() 476 uid->tag = **p; in x509_get_uid() 600 subject_key_id->tag = MBEDTLS_ASN1_OCTET_STRING; in x509_get_subject_key_id() 647 authority_key_id->keyIdentifier.tag = MBEDTLS_ASN1_OCTET_STRING; in x509_get_authority_key_id() 678 authority_key_id->authorityCertSerialNumber.tag = MBEDTLS_ASN1_INTEGER; in x509_get_authority_key_id() 787 policy_oid.tag = MBEDTLS_ASN1_OID; in x509_get_certificate_policies() 819 buf->tag = policy_oid.tag; in x509_get_certificate_policies() [all …]
|
/mbedtls-latest/include/mbedtls/ |
D | asn1.h | 87 #define MBEDTLS_ASN1_IS_STRING_TAG(tag) \ argument 88 ((unsigned int) (tag) < 32u && ( \ 89 ((1u << (tag)) & ((1u << MBEDTLS_ASN1_BMP_STRING) | \ 142 int tag; /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ member 247 size_t *len, int tag); 404 int tag); 518 int (*cb)(void *ctx, int tag,
|
D | ccm.h | 177 unsigned char *tag, size_t tag_len); 226 unsigned char *tag, size_t tag_len); 263 const unsigned char *tag, size_t tag_len); 309 const unsigned char *tag, size_t tag_len); 510 unsigned char *tag, size_t tag_len);
|
D | gcm.h | 176 unsigned char *tag); 217 const unsigned char *tag, 356 unsigned char *tag, size_t tag_len);
|
/mbedtls-latest/tests/src/drivers/ |
D | test_driver_aead.c | 342 uint8_t *tag, in mbedtls_test_transparent_aead_finish() argument 357 tag, tag_size, tag_length); in mbedtls_test_transparent_aead_finish() 361 ciphertext_length, tag, tag_size, in mbedtls_test_transparent_aead_finish() 368 (void) tag; in mbedtls_test_transparent_aead_finish() 383 const uint8_t *tag, in mbedtls_test_transparent_aead_verify() argument 424 mbedtls_ct_memcmp(tag, check_tag, tag_length) in mbedtls_test_transparent_aead_verify()
|
/mbedtls-latest/programs/psa/ |
D | aead_demo.c | 201 unsigned char tag[PSA_AEAD_TAG_MAX_SIZE]; in aead_encrypt() local 213 tag, sizeof(tag), &olen_tag)); in aead_encrypt() 215 memcpy(p, tag, olen_tag); in aead_encrypt()
|