Home
last modified time | relevance | path

Searched refs:tag (Results 1 – 25 of 64) sorted by relevance

123

/mbedtls-3.6.0/tests/suites/
Dtest_suite_ccm.data29 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 …]
Dtest_suite_pkcs7.data49 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 …]
Dtest_suite_gcm.function13 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 …]
Dtest_suite_ccm.function13 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);
105 unsigned char tag[18];
115 memset(tag, 0, sizeof(tag));
121 msg, out, tag, tag_len) == res);
124 msg, out, tag, tag_len);
148 unsigned char tag[18];
[all …]
Dtest_suite_oid.function20 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;
Dtest_suite_asn1parse.function27 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 …]
Dtest_suite_cipher.function368 unsigned char tag[16];
418 memset(tag, 0, sizeof(tag));
461 TEST_EQUAL(expected, mbedtls_cipher_write_tag(&ctx_enc, tag, sizeof(tag)));
482 TEST_EQUAL(expected, mbedtls_cipher_check_tag(&ctx_dec, tag, sizeof(tag)));
782 data_t *clear, data_t *ad, data_t *tag,
795 ((void) tag);
819 /* decode buffer and check tag->x */
831 TEST_EQUAL(tag_expected, mbedtls_cipher_check_tag(&ctx, tag->x, tag->len));
847 data_t *ad, data_t *cipher, data_t *tag,
851 * Take an AEAD ciphertext + tag and perform a pair
[all …]
Dtest_suite_pkcs12.function89 pbe_params.tag = params_tag;
107 pbe_params.tag = params_tag;
144 pbe_params.tag = params_tag;
163 pbe_params.tag = params_tag;
/mbedtls-3.6.0/library/
Dasn1parse.c62 size_t *len, int tag) in mbedtls_asn1_get_tag() argument
68 if (**p != tag) { in mbedtls_asn1_get_tag()
102 int tag, int *val) in asn1_get_tagged_int() argument
107 if ((ret = mbedtls_asn1_get_tag(p, end, &len, tag)) != 0) { in asn1_get_tagged_int()
224 int (*cb)(void *ctx, int tag, in mbedtls_asn1_traverse_sequence_of() argument
242 unsigned char const tag = *(*p)++; in mbedtls_asn1_traverse_sequence_of() local
244 if ((tag & tag_must_mask) != tag_must_val) { in mbedtls_asn1_traverse_sequence_of()
252 if ((tag & tag_may_mask) == tag_may_val) { in mbedtls_asn1_traverse_sequence_of()
254 ret = cb(ctx, tag, *p, len); in mbedtls_asn1_traverse_sequence_of()
302 int tag; member
[all …]
Dpsa_crypto_aead.c132 uint8_t *tag; in mbedtls_psa_aead_encrypt() local
147 tag = ciphertext + plaintext_length; in mbedtls_psa_aead_encrypt()
158 tag, operation.tag_length)); in mbedtls_psa_aead_encrypt()
170 operation.tag_length, tag)); in mbedtls_psa_aead_encrypt()
187 tag)); in mbedtls_psa_aead_encrypt()
191 (void) tag; in mbedtls_psa_aead_encrypt()
244 const uint8_t *tag = NULL; in mbedtls_psa_aead_decrypt() local
255 plaintext_size, &tag); in mbedtls_psa_aead_decrypt()
269 tag, operation.tag_length)); in mbedtls_psa_aead_decrypt()
280 tag, operation.tag_length, in mbedtls_psa_aead_decrypt()
[all …]
Dccm.c422 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument
450 if (tag != NULL) { in mbedtls_ccm_finish()
451 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish()
465 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument
487 if ((ret = mbedtls_ccm_finish(ctx, tag, tag_len)) != 0) { in ccm_auth_crypt()
501 unsigned char *tag, size_t tag_len) in mbedtls_ccm_star_encrypt_and_tag() argument
504 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_star_encrypt_and_tag()
511 unsigned char *tag, size_t tag_len) in mbedtls_ccm_encrypt_and_tag() argument
514 add, add_len, input, output, tag, tag_len); in mbedtls_ccm_encrypt_and_tag()
538 const unsigned char *tag, size_t tag_len) in ccm_auth_decrypt() argument
[all …]
Dx509.c79 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 …]
Dx509_create.c207 int *tag) in parse_attribute_value_hex_der_encoded() argument
244 *tag = der[0]; in parse_attribute_value_hex_der_encoded()
257 if (MBEDTLS_ASN1_IS_STRING_TAG(*tag)) { in parse_attribute_value_hex_der_encoded()
285 mbedtls_asn1_buf oid = { .p = NULL, .len = 0, .tag = MBEDTLS_ASN1_NULL }; in mbedtls_x509_string_to_names()
288 int tag; in mbedtls_x509_string_to_names() local
324 data, sizeof(data), &data_len, &tag); in mbedtls_x509_string_to_names()
340 tag = attr_descr->default_tag; in mbedtls_x509_string_to_names()
355 cur->val.tag = tag; in mbedtls_x509_string_to_names()
423 cur_name->val.tag, in x509_write_name()
Dasn1write.c55 int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsigned char tag) in mbedtls_asn1_write_tag() argument
61 *--(*p) = tag; in mbedtls_asn1_write_tag()
71 unsigned char tag) in mbedtls_asn1_write_len_and_tag() argument
76 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_asn1_write_tag(p, start, tag)); in mbedtls_asn1_write_len_and_tag()
199 static int asn1_write_tagged_int(unsigned char **p, const unsigned char *start, int val, int tag) in asn1_write_tagged_int() argument
220 return mbedtls_asn1_write_len_and_tag(p, start, len, tag); in asn1_write_tagged_int()
233 int mbedtls_asn1_write_tagged_string(unsigned char **p, const unsigned char *start, int tag, in mbedtls_asn1_write_tagged_string() argument
243 return mbedtls_asn1_write_len_and_tag(p, start, len, tag); in mbedtls_asn1_write_tagged_string()
Dchachapoly.c252 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()
Dcipher.c1164 unsigned char *tag, size_t tag_len) in mbedtls_cipher_write_tag() argument
1190 tag, tag_len); in mbedtls_cipher_write_tag()
1202 (mbedtls_chachapoly_context *) ctx->cipher_ctx, tag); in mbedtls_cipher_write_tag()
1210 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument
1253 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1274 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1391 unsigned char *tag, size_t tag_len) in mbedtls_cipher_aead_encrypt() argument
1407 if (output == NULL || tag != output + ilen) { in mbedtls_cipher_aead_encrypt()
1431 input, output, tag_len, tag); in mbedtls_cipher_aead_encrypt()
1439 tag, tag_len); in mbedtls_cipher_aead_encrypt()
[all …]
Dgcm.c498 unsigned char *tag, size_t tag_len) in mbedtls_gcm_finish() argument
525 memcpy(tag, ctx->base_ectr, tag_len); in mbedtls_gcm_finish()
539 mbedtls_xor(tag, tag, ctx->buf, tag_len); in mbedtls_gcm_finish()
555 unsigned char *tag) in mbedtls_gcm_crypt_and_tag() argument
573 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) { in mbedtls_gcm_crypt_and_tag()
586 const unsigned char *tag, in mbedtls_gcm_auth_decrypt() argument
602 diff = mbedtls_ct_memcmp(tag, check_tag, tag_len); in mbedtls_gcm_auth_decrypt()
Dx509_crt.c310 if (a->tag == b->tag && in x509_string_cmp()
316 if ((a->tag == MBEDTLS_ASN1_UTF8_STRING || a->tag == MBEDTLS_ASN1_PRINTABLE_STRING) && in x509_string_cmp()
317 (b->tag == MBEDTLS_ASN1_UTF8_STRING || b->tag == MBEDTLS_ASN1_PRINTABLE_STRING) && in x509_string_cmp()
345 if (a->oid.tag != b->oid.tag || in x509_name_cmp()
473 uid->tag = **p; in x509_get_uid()
597 subject_key_id->tag = MBEDTLS_ASN1_OCTET_STRING; in x509_get_subject_key_id()
644 authority_key_id->keyIdentifier.tag = MBEDTLS_ASN1_OCTET_STRING; in x509_get_authority_key_id()
675 authority_key_id->authorityCertSerialNumber.tag = MBEDTLS_ASN1_INTEGER; in x509_get_authority_key_id()
784 policy_oid.tag = MBEDTLS_ASN1_OID; in x509_get_certificate_policies()
816 buf->tag = policy_oid.tag; in x509_get_certificate_policies()
[all …]
/mbedtls-3.6.0/include/mbedtls/
Dasn1.h87 #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
246 size_t *len, int tag);
403 int tag);
517 int (*cb)(void *ctx, int tag,
Dccm.h169 unsigned char *tag, size_t tag_len);
218 unsigned char *tag, size_t tag_len);
255 const unsigned char *tag, size_t tag_len);
301 const unsigned char *tag, size_t tag_len);
502 unsigned char *tag, size_t tag_len);
Dgcm.h162 unsigned char *tag);
203 const unsigned char *tag,
342 unsigned char *tag, size_t tag_len);
/mbedtls-3.6.0/tests/scripts/
Dgenerate_pkcs7_tests.py117 tag = data[tag_i]
118 print("Looking at ans1: offset " + str(i) + " tag = " + tag + \
122 if tag == "02":
129 reasons.append("Change tag " + tag + " to " + new_tag)
142 if tag in ["30", "a0", "31"]:
146 reasons.append("Change contents of tag " + tag + " to contain \
157 if tag in ["30", "a0", "31"]:
Dgen_gcm_encrypt.pl65 my $tag = get_val("Tag");
75 print(":\"$tag\"");
/mbedtls-3.6.0/tests/src/drivers/
Dtest_driver_aead.c342 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-3.6.0/programs/psa/
Daead_demo.c201 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()

123