| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | | - |
| 30 | | - |
| 31 | | - |
| 32 | | - |
| 33 | | - |
| 34 | | - |
| 35 | | - |
| 36 | | - |
| 37 | | - |
| 38 | | - |
| 39 | | - |
| 40 | | - |
| 41 | | - |
| 42 | | - |
| 43 | | - |
| 44 | | - |
| 45 | | - |
| 46 | | - |
| 47 | | - |
| 48 | | - |
| 49 | | - |
| 50 | | - |
| 51 | | - |
| 52 | | - |
| 53 | | - |
| 54 | | - |
| 55 | | - |
| 56 | | - |
| 57 | | - |
| 58 | | - |
| 59 | #include <stdio.h> | - |
| 60 | | - |
| 61 | #include <openssl/asn1.h> | - |
| 62 | | - |
| 63 | int | - |
| 64 | ASN1_PRINTABLE_type(const unsigned char *s, int len) | - |
| 65 | { | - |
| 66 | int c; | - |
| 67 | int ia5 = 0; | - |
| 68 | int t61 = 0; | - |
| 69 | | - |
| 70 | if (len <= 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 71 | len = -1; never executed: len = -1; | 0 |
| 72 | if (s == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 73 | return (V_ASN1_PRINTABLESTRING); never executed: return (19); | 0 |
| 74 | | - |
| 75 | while ((*s) && (len-- != 0)) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 76 | c= *(s++); | - |
| 77 | if (!(((c >= 'a') && (c <= 'z')) ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 78 | ((c >= 'A') && (c <= 'Z')) ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 79 | (c == ' ') ||| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 80 | ((c >= '0') && (c <= '9')) ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 81 | (c == ' ') || (c == '\'') ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 82 | (c == '(') || (c == ')') ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 83 | (c == '+') || (c == ',') ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 84 | (c == '-') || (c == '.') ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 85 | (c == '/') || (c == ':') ||| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 86 | (c == '=') || (c == '?')))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 87 | ia5 = 1; never executed: ia5 = 1; | 0 |
| 88 | if (c & 0x80)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 89 | t61 = 1; never executed: t61 = 1; | 0 |
| 90 | } never executed: end of block | 0 |
| 91 | if (t61)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 92 | return (V_ASN1_T61STRING); never executed: return (20); | 0 |
| 93 | if (ia5)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 94 | return (V_ASN1_IA5STRING); never executed: return (22); | 0 |
| 95 | return (V_ASN1_PRINTABLESTRING); never executed: return (19); | 0 |
| 96 | } | - |
| 97 | | - |
| 98 | int | - |
| 99 | ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) | - |
| 100 | { | - |
| 101 | int i; | - |
| 102 | unsigned char *p; | - |
| 103 | | - |
| 104 | if (s->type != V_ASN1_UNIVERSALSTRING)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 105 | return (0); never executed: return (0); | 0 |
| 106 | if ((s->length % 4) != 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 107 | return (0); never executed: return (0); | 0 |
| 108 | p = s->data; | - |
| 109 | for (i = 0; i < s->length; i += 4) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 110 | if ((p[0] != '\0') || (p[1] != '\0') || (p[2] != '\0'))| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 111 | break; never executed: break; | 0 |
| 112 | else | - |
| 113 | p += 4; never executed: p += 4; | 0 |
| 114 | } | - |
| 115 | if (i < s->length)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 116 | return (0); never executed: return (0); | 0 |
| 117 | p = s->data; | - |
| 118 | for (i = 3; i < s->length; i += 4) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 119 | *(p++) = s->data[i]; | - |
| 120 | } never executed: end of block | 0 |
| 121 | *(p) = '\0'; | - |
| 122 | s->length /= 4; | - |
| 123 | s->type = ASN1_PRINTABLE_type(s->data, s->length); | - |
| 124 | return (1); never executed: return (1); | 0 |
| 125 | } | - |
| | |