Branch Coverage

PKCS12.xs
Criterion Covered Total %
branch 51 98 52.0


line true false branch
50 0 1 if (!strncmp(keyString, "----", 4)) {
52 0 0 CHECK_OPEN_SSL(stringBIO = BIO_new_mem_buf(keyString, strlen(keyString)));
56 0 1 CHECK_OPEN_SSL(stringBIO = BIO_new_file(keyString, "r"));
64 0 1 CHECK_OPEN_SSL(pkey);
75 0 1 if (!strncmp(keyString, "----", 4)) {
76 0 0 CHECK_OPEN_SSL(stringBIO = BIO_new_mem_buf(keyString, strlen(keyString)));
78 0 1 CHECK_OPEN_SSL(stringBIO = BIO_new_file(keyString, "r"));
82 1 1 for (i = 0; i < sk_X509_INFO_num(xis); i++) {
84 1 0 if (xi->x509 != NULL && stack != NULL) {
1 0 if (xi->x509 != NULL && stack != NULL) {
85 0 1 CHECK_OPEN_SSL(xi->x509);
86 0 1 if (!sk_X509_push(stack, xi->x509))
103 17 23 if (m == BIO_CB_WRITE) {
108 0 40 if (m == BIO_CB_PUTS) {
140 0 3 if (!sv) sv = &PL_sv_undef;
148 0 0 if (sv) sv_free(sv);
162 0 0 return SvPV(sv, l);
177 0 0 if (options & NOKEYS) return 1;
181 0 0 if (!(pkey = EVP_PKCS82PKEY (p8c))) return 0;
191 1 1 if (options & NOKEYS) return 1;
193 0 1 if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen)))
196 0 1 if (!(pkey = EVP_PKCS82PKEY (p8))) {
211 2 2 if (options & NOCERTS) return 1;
213 1 1 if (PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID)) {
215 0 1 if (options & CACERTS) return 1;
217 1 0 } else if (options & CLCERTS) {
222 0 1 if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate) return 1;
224 0 1 if (!(x509 = PKCS12_certbag2x509(bag))) return 0;
240 6 4 for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
242 0 6 if (!dump_certs_pkeys_bag (bio, sk_PKCS12_SAFEBAG_value (bags, i), pass, passlen, options, pempass)) {
258 0 2 if ((asafes = PKCS12_unpack_authsafes(p12)) == NULL) {
263 4 2 for (i = 0; i < sk_PKCS7_num(asafes); i++) {
269 2 2 if (bagnid == NID_pkcs7_data) {
273 2 0 } else if (bagnid == NID_pkcs7_encrypted) {
281 0 4 if (!bags) return 0;
283 0 4 if (!dump_certs_pkeys_bags(bio, bags, pass, passlen, options, pempass)) {
320 10 2 for (i = 0; (name = Crypt__OpenSSL__PKCS12__const[i].n); i++) {
331 0 0 if ((RETVAL = PKCS12_new()) == NULL) {
351 0 2 if (!string) croak("PKCS12_new_from: No string or file was passed.");
353 2 0 if (ix == 1) {
359 0 2 if (!bio) croak("Failed to create BIO");
362 0 2 if ((RETVAL = d2i_PKCS12_bio(bio, 0)) == NULL) {
378 2 0 if (pkcs12) {
405 0 1 if (!(i2d_PKCS12_bio(bio, pkcs12))) {
422 0 3 if (!(PKCS12_verify_mac(pkcs12, pwd, strlen(pwd)))) {
426 3 0 RETVAL = (PKCS12_verify_mac(pkcs12, pwd, strlen(pwd))) ? &PL_sv_yes : &PL_sv_no;
439 0 2 if (!(PKCS12_newpass(pkcs12, oldpwd, newpwd))) {
469 0 1 if (!p12) {
474 0 1 if (!(fp = fopen(file, "wb"))) {