include/cjws/cjws_util.h

filter: Statementstmt 100% 3 / 3 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 5 / 5 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Crypt/JWS/Key.pm ↑ Summary
1 #ifndef CJWS_UTIL_H
2 #define CJWS_UTIL_H
3  
4 #include <openssl/crypto.h>
5  
6 /* Constant-time equality. Length inequality returns 0 immediately - the
7 * lengths of the values compared here (digests, signatures) are public. */
8 13 static int cjws_ct_eq(const unsigned char *a, STRLEN alen,
9 const unsigned char *b, STRLEN blen) {
10 13 ▶ if (alen != blen) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (alen != blen) return 0; 1 12 13
11 12 return CRYPTO_memcmp(a, b, alen) == 0;
12 }
13  
14 #endif
« blib/lib/Crypt/JWS/Key.pm ↑ Summary