OpenCoverage

o_str.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/o_str.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3int OPENSSL_memcmp(const void *v1, const void *v2, size_t n)-
4{-
5 const unsigned char *c1 = v1, *c2 = v2;-
6 int ret = 0;-
7-
8 while (n
nDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(ret = *c1 - *c2) == 0Description
TRUEnever evaluated
FALSEnever evaluated
ret = *c1 - *c2) == 0
(ret = *c1 - *c2) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
9 n--, c1++, c2++;
never executed: n--, c1++, c2++;
0
10-
11 return
never executed: return ret;
ret;
never executed: return ret;
0
12}-
13-
14char *CRYPTO_strdup(const char *str, const char* file, int line)-
15{-
16 char *ret;-
17-
18 if (str ==
str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 226510 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-226510
19 ((void *)0)
str == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 226510 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
0-226510
20 )-
21 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
22 ((void *)0)
never executed: return ((void *)0) ;
0
23 ;
never executed: return ((void *)0) ;
0
24 ret = CRYPTO_malloc(strlen(str) + 1, file, line);-
25 if (ret !=
ret != ((void *)0)Description
TRUEevaluated 226510 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
0-226510
26 ((void *)0)
ret != ((void *)0)Description
TRUEevaluated 226510 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEnever evaluated
0-226510
27 )-
28 strcpy(ret, str);
executed 226510 times by 12 tests: strcpy(ret, str);
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
226510
29 return
executed 226510 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
ret;
executed 226510 times by 12 tests: return ret;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
226510
30}-
31-
32char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)-
33{-
34 size_t maxlen;-
35 char *ret;-
36-
37 if (str ==
str == ((void *)0)Description
TRUEevaluated 998 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18080 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
998-18080
38 ((void *)0)
str == ((void *)0)Description
TRUEevaluated 998 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18080 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
998-18080
39 )-
40 return
executed 998 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 998 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
998
41 ((void *)0)
executed 998 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
998
42 ;
executed 998 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
998
43-
44 maxlen = OPENSSL_strnlen(str, s);-
45-
46 ret = CRYPTO_malloc(maxlen + 1, file, line);-
47 if (ret
retDescription
TRUEevaluated 18080 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-18080
48 memcpy(ret, str, maxlen);-
49 ret[maxlen] = '\0';-
50 }
executed 18080 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18080
51 return
executed 18080 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 18080 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
18080
52}-
53-
54void *CRYPTO_memdup(const void *data, size_t siz, const char* file, int line)-
55{-
56 void *ret;-
57-
58 if (data ==
data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 126466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-126466
59 ((void *)0)
data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 126466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-126466
60 || siz >= 0x7fffffff
siz >= 0x7fffffffDescription
TRUEnever evaluated
FALSEevaluated 126466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-126466
61 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
62 ((void *)0)
never executed: return ((void *)0) ;
0
63 ;
never executed: return ((void *)0) ;
0
64-
65 ret = CRYPTO_malloc(siz, file, line);-
66 if (ret ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 126466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-126466
67 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 126466 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-126466
68 ) {-
69 ERR_put_error(15,(115),((1|64)),__FILE__,66);-
70 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
71 ((void *)0)
never executed: return ((void *)0) ;
0
72 ;
never executed: return ((void *)0) ;
0
73 }-
74 return
executed 126466 times by 1 test: return memcpy(ret, data, siz);
Executed by:
  • libcrypto.so.1.1
memcpy(ret, data, siz);
executed 126466 times by 1 test: return memcpy(ret, data, siz);
Executed by:
  • libcrypto.so.1.1
126466
75}-
76-
77size_t OPENSSL_strnlen(const char *str, size_t maxlen)-
78{-
79 const char *p;-
80-
81 for (p = str; maxlen-- != 0
maxlen-- != 0Description
TRUEevaluated 16194599 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEevaluated 25614 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& *
*p != '\0'Description
TRUEevaluated 13728419 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEevaluated 2466180 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
p != '\0'
*p != '\0'Description
TRUEevaluated 13728419 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
FALSEevaluated 2466180 times by 12 tests
Evaluated by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
; ++p) ;
executed 13728419 times by 12 tests: ;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
25614-16194599
82-
83 return
executed 2491794 times by 12 tests: return p - str;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
p - str;
executed 2491794 times by 12 tests: return p - str;
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • rdrand_sanitytest
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
2491794
84}-
85-
86size_t OPENSSL_strlcpy(char *dst, const char *src, size_t size)-
87{-
88 size_t l = 0;-
89 for (; size > 1
size > 1Description
TRUEevaluated 27559499 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9058 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& *
*srcDescription
TRUEevaluated 24856165 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2703334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
src
*srcDescription
TRUEevaluated 24856165 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2703334 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; size--) {
9058-27559499
90 *dst++ = *src++;-
91 l++;-
92 }
executed 24856165 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24856165
93 if (size
sizeDescription
TRUEevaluated 2710473 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1919 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1919-2710473
94 *
executed 2710473 times by 1 test: *dst = '\0';
Executed by:
  • libcrypto.so.1.1
dst = '\0';
executed 2710473 times by 1 test: *dst = '\0';
Executed by:
  • libcrypto.so.1.1
2710473
95 return
executed 2712392 times by 1 test: return l + strlen(src);
Executed by:
  • libcrypto.so.1.1
l + strlen(src);
executed 2712392 times by 1 test: return l + strlen(src);
Executed by:
  • libcrypto.so.1.1
2712392
96}-
97-
98size_t OPENSSL_strlcat(char *dst, const char *src, size_t size)-
99{-
100 size_t l = 0;-
101 for (; size > 0
size > 0Description
TRUEevaluated 21486302 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& *
*dstDescription
TRUEevaluated 19355459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2130843 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dst
*dstDescription
TRUEevaluated 19355459 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2130843 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; size--, dst++)
0-21486302
102 l++;
executed 19355459 times by 1 test: l++;
Executed by:
  • libcrypto.so.1.1
19355459
103 return
executed 2130843 times by 1 test: return l + OPENSSL_strlcpy(dst, src, size);
Executed by:
  • libcrypto.so.1.1
l + OPENSSL_strlcpy(dst, src, size);
executed 2130843 times by 1 test: return l + OPENSSL_strlcpy(dst, src, size);
Executed by:
  • libcrypto.so.1.1
2130843
104}-
105-
106int OPENSSL_hexchar2int(unsigned char c)-
107{-
108-
109-
110-
111-
112 switch (c) {-
113 case
executed 155917 times by 2 tests: case '0':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'0':
executed 155917 times by 2 tests: case '0':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
155917
114 return
executed 155917 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0;
executed 155917 times by 2 tests: return 0;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
155917
115 case
executed 75519 times by 2 tests: case '1':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'1':
executed 75519 times by 2 tests: case '1':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
75519
116 return
executed 75519 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
1;
executed 75519 times by 2 tests: return 1;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
75519
117 case
executed 70030 times by 2 tests: case '2':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'2':
executed 70030 times by 2 tests: case '2':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
70030
118 return
executed 70030 times by 2 tests: return 2;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
2;
executed 70030 times by 2 tests: return 2;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
70030
119 case
executed 66553 times by 2 tests: case '3':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'3':
executed 66553 times by 2 tests: case '3':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66553
120 return
executed 66553 times by 2 tests: return 3;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3;
executed 66553 times by 2 tests: return 3;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66553
121 case
executed 75176 times by 2 tests: case '4':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'4':
executed 75176 times by 2 tests: case '4':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
75176
122 return
executed 75176 times by 2 tests: return 4;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
4;
executed 75176 times by 2 tests: return 4;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
75176
123 case
executed 68575 times by 2 tests: case '5':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'5':
executed 68575 times by 2 tests: case '5':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
68575
124 return
executed 68575 times by 2 tests: return 5;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5;
executed 68575 times by 2 tests: return 5;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
68575
125 case
executed 67523 times by 2 tests: case '6':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'6':
executed 67523 times by 2 tests: case '6':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
67523
126 return
executed 67523 times by 2 tests: return 6;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
6;
executed 67523 times by 2 tests: return 6;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
67523
127 case
executed 66151 times by 2 tests: case '7':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'7':
executed 66151 times by 2 tests: case '7':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66151
128 return
executed 66151 times by 2 tests: return 7;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
7;
executed 66151 times by 2 tests: return 7;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66151
129 case
executed 63978 times by 2 tests: case '8':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'8':
executed 63978 times by 2 tests: case '8':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
63978
130 return
executed 63978 times by 2 tests: return 8;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
8;
executed 63978 times by 2 tests: return 8;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
63978
131 case
executed 65097 times by 2 tests: case '9':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'9':
executed 65097 times by 2 tests: case '9':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
65097
132 return
executed 65097 times by 2 tests: return 9;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9;
executed 65097 times by 2 tests: return 9;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
65097
133 case
executed 61123 times by 2 tests: case 'a':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'a':
executed 61123 times by 2 tests: case 'a':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 5470 times by 2 tests: case 'A':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'A':
executed 5470 times by 2 tests: case 'A':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5470-61123
134 return
executed 66593 times by 2 tests: return 0x0A;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0A;
executed 66593 times by 2 tests: return 0x0A;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
66593
135 case
executed 58044 times by 2 tests: case 'b':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'b':
executed 58044 times by 2 tests: case 'b':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 5647 times by 2 tests: case 'B':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'B':
executed 5647 times by 2 tests: case 'B':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5647-58044
136 return
executed 63691 times by 2 tests: return 0x0B;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0B;
executed 63691 times by 2 tests: return 0x0B;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
63691
137 case
executed 60633 times by 2 tests: case 'c':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'c':
executed 60633 times by 2 tests: case 'c':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 5335 times by 2 tests: case 'C':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'C':
executed 5335 times by 2 tests: case 'C':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5335-60633
138 return
executed 65968 times by 2 tests: return 0x0C;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0C;
executed 65968 times by 2 tests: return 0x0C;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
65968
139 case
executed 58883 times by 2 tests: case 'd':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'd':
executed 58883 times by 2 tests: case 'd':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 5608 times by 2 tests: case 'D':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'D':
executed 5608 times by 2 tests: case 'D':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5608-58883
140 return
executed 64491 times by 2 tests: return 0x0D;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0D;
executed 64491 times by 2 tests: return 0x0D;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
64491
141 case
executed 59695 times by 2 tests: case 'e':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'e':
executed 59695 times by 2 tests: case 'e':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 5717 times by 2 tests: case 'E':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'E':
executed 5717 times by 2 tests: case 'E':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
5717-59695
142 return
executed 65412 times by 2 tests: return 0x0E;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0E;
executed 65412 times by 2 tests: return 0x0E;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
65412
143 case
executed 68533 times by 2 tests: case 'f':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'f':
executed 68533 times by 2 tests: case 'f':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
case
executed 9686 times by 2 tests: case 'F':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
'F':
executed 9686 times by 2 tests: case 'F':
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
9686-68533
144 return
executed 78219 times by 2 tests: return 0x0F;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
0x0F;
executed 78219 times by 2 tests: return 0x0F;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
78219
145 }-
146 return
never executed: return -1;
-1;
never executed: return -1;
0
147}-
148-
149-
150-
151-
152unsigned char *OPENSSL_hexstr2buf(const char *str, long *len)-
153{-
154 unsigned char *hexbuf, *q;-
155 unsigned char ch, cl;-
156 int chi, cli;-
157 const unsigned char *p;-
158 size_t s;-
159-
160 s = strlen(str);-
161 if ((
(hexbuf = CRYP...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
hexbuf = CRYPTO_malloc(s >> 1, __FILE__, 156)) ==
(hexbuf = CRYP...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3305
162 ((void *)0)
(hexbuf = CRYP...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 3305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
0-3305
163 ) {-
164 ERR_put_error(15,(118),((1|64)),__FILE__,157);-
165 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
166 ((void *)0)
never executed: return ((void *)0) ;
0
167 ;
never executed: return ((void *)0) ;
0
168 }-
169 for (p = (const unsigned char *)str, q = hexbuf; *
*pDescription
TRUEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
p
*pDescription
TRUEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
FALSEevaluated 3305 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
; ) {
3305-185590
170 ch = *p++;-
171 if (ch == ':'
ch == ':'Description
TRUEnever evaluated
FALSEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
0-185590
172 continue;
never executed: continue;
0
173 cl = *p++;-
174 if (!cl
!clDescription
TRUEnever evaluated
FALSEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-185590
175 ERR_put_error(15,(118),(103),__FILE__,167)-
176 ;-
177 CRYPTO_free(hexbuf, __FILE__, 168);-
178 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
179 ((void *)0)
never executed: return ((void *)0) ;
0
180 ;
never executed: return ((void *)0) ;
0
181 }-
182 cli = OPENSSL_hexchar2int(cl);-
183 chi = OPENSSL_hexchar2int(ch);-
184 if (cli < 0
cli < 0Description
TRUEnever evaluated
FALSEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
|| chi < 0
chi < 0Description
TRUEnever evaluated
FALSEevaluated 185590 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
) {
0-185590
185 CRYPTO_free(hexbuf, __FILE__, 174);-
186 ERR_put_error(15,(118),(102),__FILE__,175);-
187 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
188 ((void *)0)
never executed: return ((void *)0) ;
0
189 ;
never executed: return ((void *)0) ;
0
190 }-
191 *q++ = (unsigned char)((chi << 4) | cli);-
192 }
executed 185590 times by 2 tests: end of block
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
185590
193-
194 if (len
lenDescription
TRUEevaluated 3279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • libcrypto.so.1.1
  • sm2_internal_test
)
26-3279
195 *
executed 3279 times by 1 test: *len = q - hexbuf;
Executed by:
  • libcrypto.so.1.1
len = q - hexbuf;
executed 3279 times by 1 test: *len = q - hexbuf;
Executed by:
  • libcrypto.so.1.1
3279
196 return
executed 3305 times by 2 tests: return hexbuf;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
hexbuf;
executed 3305 times by 2 tests: return hexbuf;
Executed by:
  • libcrypto.so.1.1
  • sm2_internal_test
3305
197}-
198-
199-
200-
201-
202-
203-
204char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)-
205{-
206 static const char hexdig[] = "0123456789ABCDEF";-
207 char *tmp, *q;-
208 const unsigned char *p;-
209 int i;-
210-
211 if (len == 0
len == 0Description
TRUEevaluated 438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
438-1212
212 {-
213 return
executed 438 times by 1 test: return CRYPTO_zalloc(1, __FILE__, 200);
Executed by:
  • libcrypto.so.1.1
CRYPTO_zalloc(1, __FILE__, 200);
executed 438 times by 1 test: return CRYPTO_zalloc(1, __FILE__, 200);
Executed by:
  • libcrypto.so.1.1
438
214 }-
215-
216 if ((
(tmp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
tmp = CRYPTO_malloc(len * 3, __FILE__, 203)) ==
(tmp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1212
217 ((void *)0)
(tmp = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1212
218 ) {-
219 ERR_put_error(15,(117),((1|64)),__FILE__,204);-
220 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
221 ((void *)0)
never executed: return ((void *)0) ;
0
222 ;
never executed: return ((void *)0) ;
0
223 }-
224 q = tmp;-
225 for (i = 0, p = buffer; i < len
i < lenDescription
TRUEevaluated 134911 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1212 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++, p++) {
1212-134911
226 *q++ = hexdig[(*p >> 4) & 0xf];-
227 *q++ = hexdig[*p & 0xf];-
228 *q++ = ':';-
229 }
executed 134911 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
134911
230 q[-1] = 0;-
231-
232-
233-
234-
235 return
executed 1212 times by 1 test: return tmp;
Executed by:
  • libcrypto.so.1.1
tmp;
executed 1212 times by 1 test: return tmp;
Executed by:
  • libcrypto.so.1.1
1212
236}-
237-
238int openssl_strerror_r(int errnum, char *buf, size_t buflen)-
239{-
240 return
executed 263398 times by 11 tests: return !strerror_r(errnum, buf, buflen);
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
!strerror_r(errnum, buf, buflen);
executed 263398 times by 11 tests: return !strerror_r(errnum, buf, buflen);
Executed by:
  • asn1_internal_test
  • chacha_internal_test
  • ctype_internal_test
  • curve448_internal_test
  • libcrypto.so.1.1
  • modes_internal_test
  • poly1305_internal_test
  • siphash_internal_test
  • sm2_internal_test
  • sm4_internal_test
  • x509_internal_test
263398
241}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2