include/cjws/cjws_rand.h

filter: Statementstmt 75.0% 3 / 4 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 66.6% 4 / 6 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/arch/Crypt/JWS/Install/Files.pm ↑ Summary xs/jws.xs »
1 #ifndef CJWS_RAND_H
2 #define CJWS_RAND_H
3  
4 #include <openssl/rand.h>
5  
6 /* CSPRNG via RAND_bytes. Failure croaks - a weak token is worse than no
7 * token (pk_random_bytes precedent: never degrade). */
8 62 static void cjws_random_bytes(pTHX_ unsigned char *buf, STRLEN n) {
9 62 ▶ if (RAND_bytes(buf, (int)n) != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (RAND_bytes(buf, (int)n) != 1) 0 62 62
10 0 croak("Crypt::JWS: RAND_bytes failed");
11 62 }
12  
13 #endif
« blib/arch/Crypt/JWS/Install/Files.pm ↑ Summary xs/jws.xs »