/src/openssl33/crypto/asn1/tasn_typ.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #include <stdio.h> |
11 | | #include <openssl/asn1.h> |
12 | | #include <openssl/asn1t.h> |
13 | | |
14 | | /* Declarations for string types */ |
15 | | |
16 | | #define IMPLEMENT_ASN1_STRING_FUNCTIONS(sname) \ |
17 | | IMPLEMENT_ASN1_TYPE(sname) \ |
18 | | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(sname, sname, sname) \ |
19 | 12.1M | sname *sname##_new(void) \ |
20 | 12.1M | { \ |
21 | 12.1M | return ASN1_STRING_type_new(V_##sname); \ |
22 | 12.1M | } \ Line | Count | Source | 19 | 145k | sname *sname##_new(void) \ | 20 | 145k | { \ | 21 | 145k | return ASN1_STRING_type_new(V_##sname); \ | 22 | 145k | } \ |
Line | Count | Source | 19 | 7.06M | sname *sname##_new(void) \ | 20 | 7.06M | { \ | 21 | 7.06M | return ASN1_STRING_type_new(V_##sname); \ | 22 | 7.06M | } \ |
Unexecuted instantiation: ASN1_ENUMERATED_new Line | Count | Source | 19 | 4.65M | sname *sname##_new(void) \ | 20 | 4.65M | { \ | 21 | 4.65M | return ASN1_STRING_type_new(V_##sname); \ | 22 | 4.65M | } \ |
Line | Count | Source | 19 | 130k | sname *sname##_new(void) \ | 20 | 130k | { \ | 21 | 130k | return ASN1_STRING_type_new(V_##sname); \ | 22 | 130k | } \ |
Unexecuted instantiation: ASN1_PRINTABLESTRING_new Unexecuted instantiation: ASN1_T61STRING_new Unexecuted instantiation: ASN1_IA5STRING_new Unexecuted instantiation: ASN1_GENERALSTRING_new Unexecuted instantiation: ASN1_UTCTIME_new Line | Count | Source | 19 | 139k | sname *sname##_new(void) \ | 20 | 139k | { \ | 21 | 139k | return ASN1_STRING_type_new(V_##sname); \ | 22 | 139k | } \ |
Unexecuted instantiation: ASN1_VISIBLESTRING_new Unexecuted instantiation: ASN1_UNIVERSALSTRING_new Unexecuted instantiation: ASN1_BMPSTRING_new |
23 | 26.7M | void sname##_free(sname *x) \ |
24 | 26.7M | { \ |
25 | 26.7M | ASN1_STRING_free(x); \ |
26 | 26.7M | } Line | Count | Source | 23 | 10.6M | void sname##_free(sname *x) \ | 24 | 10.6M | { \ | 25 | 10.6M | ASN1_STRING_free(x); \ | 26 | 10.6M | } |
Line | Count | Source | 23 | 7.77M | void sname##_free(sname *x) \ | 24 | 7.77M | { \ | 25 | 7.77M | ASN1_STRING_free(x); \ | 26 | 7.77M | } |
Line | Count | Source | 23 | 5.14M | void sname##_free(sname *x) \ | 24 | 5.14M | { \ | 25 | 5.14M | ASN1_STRING_free(x); \ | 26 | 5.14M | } |
Line | Count | Source | 23 | 3.16M | void sname##_free(sname *x) \ | 24 | 3.16M | { \ | 25 | 3.16M | ASN1_STRING_free(x); \ | 26 | 3.16M | } |
Unexecuted instantiation: ASN1_UTF8STRING_free Unexecuted instantiation: ASN1_PRINTABLESTRING_free Unexecuted instantiation: ASN1_T61STRING_free Unexecuted instantiation: ASN1_IA5STRING_free Unexecuted instantiation: ASN1_GENERALSTRING_free Unexecuted instantiation: ASN1_UTCTIME_free ASN1_GENERALIZEDTIME_free Line | Count | Source | 23 | 92.4k | void sname##_free(sname *x) \ | 24 | 92.4k | { \ | 25 | 92.4k | ASN1_STRING_free(x); \ | 26 | 92.4k | } |
Unexecuted instantiation: ASN1_VISIBLESTRING_free Unexecuted instantiation: ASN1_UNIVERSALSTRING_free Unexecuted instantiation: ASN1_BMPSTRING_free |
27 | | |
28 | 79.5M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) |
29 | 121M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) |
30 | 121M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) |
31 | 77.6M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING) |
32 | 77.6M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING) |
33 | 3.45M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_PRINTABLESTRING) |
34 | 264k | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_T61STRING) |
35 | 17.5M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_IA5STRING) |
36 | 17.5M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING) |
37 | 154k | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME) |
38 | 7.33M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME) |
39 | 7.33M | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING) |
40 | 154k | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING) |
41 | 154k | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BMPSTRING) |
42 | 154k | |
43 | 1.19M | IMPLEMENT_ASN1_TYPE(ASN1_NULL) |
44 | 1.19M | IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL) |
45 | 1.19M | |
46 | 478M | IMPLEMENT_ASN1_TYPE(ASN1_OBJECT) |
47 | 478M | |
48 | 638M | IMPLEMENT_ASN1_TYPE(ASN1_ANY) |
49 | 638M | |
50 | 638M | /* Just swallow an ASN1_SEQUENCE in an ASN1_STRING */ |
51 | 638M | IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE) |
52 | 22.6M | |
53 | 22.6M | IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) |
54 | 22.6M | |
55 | 22.6M | /* Multistring types */ |
56 | 22.6M | |
57 | 183M | IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE) |
58 | | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) |
59 | | |
60 | 654k | IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT) |
61 | | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) |
62 | | |
63 | 671k | IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING) |
64 | | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) |
65 | | |
66 | | /* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ |
67 | 7.73M | IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1) |
68 | 247k | IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1) |
69 | 23.0M | IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0) |
70 | | |
71 | | /* Special, OCTET STRING with indefinite length constructed support */ |
72 | | |
73 | 1.03M | IMPLEMENT_ASN1_TYPE_ex(ASN1_OCTET_STRING_NDEF, ASN1_OCTET_STRING, ASN1_TFLG_NDEF) |
74 | | |
75 | | ASN1_ITEM_TEMPLATE(ASN1_SEQUENCE_ANY) = |
76 | | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, ASN1_SEQUENCE_ANY, ASN1_ANY) |
77 | 144k | ASN1_ITEM_TEMPLATE_END(ASN1_SEQUENCE_ANY) |
78 | | |
79 | | ASN1_ITEM_TEMPLATE(ASN1_SET_ANY) = |
80 | | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, ASN1_SET_ANY, ASN1_ANY) |
81 | | ASN1_ITEM_TEMPLATE_END(ASN1_SET_ANY) |
82 | | |
83 | | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) |
84 | | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(ASN1_SEQUENCE_ANY, ASN1_SET_ANY, ASN1_SET_ANY) |