| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/tasn_typ.c |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /* | - |
| 2 | * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. | - |
| 3 | * | - |
| 4 | * Licensed under the OpenSSL license (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 | sname *sname##_new(void) \ | - |
| 20 | { \ | - |
| 21 | return ASN1_STRING_type_new(V_##sname); \ | - |
| 22 | } \ | - |
| 23 | void sname##_free(sname *x) \ | - |
| 24 | { \ | - |
| 25 | ASN1_STRING_free(x); \ | - |
| 26 | } | - |
| 27 | - | |
| 28 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) executed 583024 times by 2 tests: end of blockExecuted by:
executed 101093 times by 1 test: return (ASN1_OCTET_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_OCTET_STRING_it)));Executed by:
executed 87 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_OCTET_STRING_it)));Executed by:
executed 17876 times by 2 tests: return ASN1_STRING_type_new(4);Executed by:
| 87-583024 |
| 29 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) executed 197716 times by 1 test: end of blockExecuted by:
executed 117664 times by 1 test: return (ASN1_INTEGER *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_INTEGER_it)));Executed by:
executed 1240 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_INTEGER_it)));Executed by:
executed 173404 times by 1 test: return ASN1_STRING_type_new(2);Executed by:
| 1240-197716 |
| 30 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) executed 7189 times by 1 test: end of blockExecuted by:
executed 3812 times by 1 test: return (ASN1_ENUMERATED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_ENUMERATED_it)));Executed by:
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_ENUMERATED_it)));never executed: return ASN1_STRING_type_new(10); | 0-7189 |
| 31 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING) executed 8996 times by 1 test: end of blockExecuted by:
never executed: return (ASN1_BIT_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_BIT_STRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_BIT_STRING_it)));executed 23041 times by 1 test: return ASN1_STRING_type_new(3);Executed by:
| 0-23041 |
| 32 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTF8STRING) never executed: end of blocknever executed: return (ASN1_UTF8STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_UTF8STRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_UTF8STRING_it)));never executed: return ASN1_STRING_type_new(12); | 0 |
| 33 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_PRINTABLESTRING) never executed: end of blocknever executed: return (ASN1_PRINTABLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_PRINTABLESTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_PRINTABLESTRING_it)));never executed: return ASN1_STRING_type_new(19); | 0 |
| 34 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_T61STRING) never executed: end of blocknever executed: return (ASN1_T61STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_T61STRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_T61STRING_it)));never executed: return ASN1_STRING_type_new(20); | 0 |
| 35 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_IA5STRING) executed 102 times by 1 test: end of blockExecuted by:
never executed: return (ASN1_IA5STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_IA5STRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_IA5STRING_it)));executed 107 times by 1 test: return ASN1_STRING_type_new(22);Executed by:
| 0-107 |
| 36 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALSTRING) never executed: end of blocknever executed: return (ASN1_GENERALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_GENERALSTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_GENERALSTRING_it)));never executed: return ASN1_STRING_type_new(27); | 0 |
| 37 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UTCTIME) never executed: end of blocknever executed: return (ASN1_UTCTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_UTCTIME_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_UTCTIME_it)));never executed: return ASN1_STRING_type_new(23); | 0 |
| 38 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_GENERALIZEDTIME) executed 2338 times by 1 test: end of blockExecuted by:
never executed: return (ASN1_GENERALIZEDTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_GENERALIZEDTIME_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_GENERALIZEDTIME_it)));executed 2338 times by 1 test: return ASN1_STRING_type_new(24);Executed by:
| 0-2338 |
| 39 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_VISIBLESTRING) never executed: end of blocknever executed: return (ASN1_VISIBLESTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_VISIBLESTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_VISIBLESTRING_it)));never executed: return ASN1_STRING_type_new(26); | 0 |
| 40 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_UNIVERSALSTRING) never executed: end of blocknever executed: return (ASN1_UNIVERSALSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_UNIVERSALSTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_UNIVERSALSTRING_it)));never executed: return ASN1_STRING_type_new(28); | 0 |
| 41 | IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BMPSTRING) never executed: end of blocknever executed: return (ASN1_BMPSTRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_BMPSTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_BMPSTRING_it)));never executed: return ASN1_STRING_type_new(30); | 0 |
| 42 | - | |
| 43 | IMPLEMENT_ASN1_TYPE(ASN1_NULL) | - |
| 44 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL) never executed: end of blocknever executed: return (ASN1_NULL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_NULL_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_NULL_it)));executed 2 times by 1 test: return (ASN1_NULL *)ASN1_item_new((&(ASN1_NULL_it)));Executed by:
| 0-2 |
| 45 | - | |
| 46 | IMPLEMENT_ASN1_TYPE(ASN1_OBJECT) | - |
| 47 | - | |
| 48 | IMPLEMENT_ASN1_TYPE(ASN1_ANY) | - |
| 49 | - | |
| 50 | /* Just swallow an ASN1_SEQUENCE in an ASN1_STRING */ | - |
| 51 | IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE) | - |
| 52 | - | |
| 53 | IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) executed 30523 times by 1 test: end of blockExecuted by:
never executed: return (ASN1_TYPE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_ANY_it)));executed 7832 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_ANY_it)));Executed by:
executed 228911 times by 1 test: return (ASN1_TYPE *)ASN1_item_new((&(ASN1_ANY_it)));Executed by:
| 0-228911 |
| 54 | - | |
| 55 | /* Multistring types */ | - |
| 56 | - | |
| 57 | IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE) | - |
| 58 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) never executed: end of blocknever executed: return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_PRINTABLE_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_PRINTABLE_it)));never executed: return (ASN1_STRING *)ASN1_item_new((&(ASN1_PRINTABLE_it))); | 0 |
| 59 | - | |
| 60 | IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT) | - |
| 61 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) never executed: end of blocknever executed: return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(DISPLAYTEXT_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(DISPLAYTEXT_it)));never executed: return (ASN1_STRING *)ASN1_item_new((&(DISPLAYTEXT_it))); | 0 |
| 62 | - | |
| 63 | IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING) | - |
| 64 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) never executed: end of blocknever executed: return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(DIRECTORYSTRING_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(DIRECTORYSTRING_it)));never executed: return (ASN1_STRING *)ASN1_item_new((&(DIRECTORYSTRING_it))); | 0 |
| 65 | - | |
| 66 | /* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ | - |
| 67 | IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1) | - |
| 68 | IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1) | - |
| 69 | IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0) | - |
| 70 | - | |
| 71 | /* Special, OCTET STRING with indefinite length constructed support */ | - |
| 72 | - | |
| 73 | 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 | 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_const_fname(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) executed 3339 times by 1 test: return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_SEQUENCE_ANY_it)));Executed by:
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_SEQUENCE_ANY_it))); | 0-3339 |
| 84 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(ASN1_SEQUENCE_ANY, ASN1_SET_ANY, ASN1_SET_ANY) never executed: return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_SET_ANY_it)));never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_SET_ANY_it))); | 0 |
| Source code | Switch to Preprocessed file |