Branch Coverage

SSLeay.xs
Criterion Covered Total %
branch 620 1806 34.3


line true false branch
243 1 0 if (trace && SvIOK(trace) && SvIV(trace)>=level) {
1 0 if (trace && SvIOK(trace) && SvIV(trace)>=level) {
1 0 if (trace && SvIOK(trace) && SvIV(trace)>=level) {
0 1 if (trace && SvIOK(trace) && SvIV(trace)>=level) {
431 50 39 if (!m) return; /* Skip aliases */
433 18 21 if (strcmp(from, mname)) return; /* Skip shortnames */
435 5 16 if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST) return; /* Skip clones */
437 0 16 if (strchr(mname, ' ')) mname= EVP_MD_name(m);
493 10 0 if (cb) {
497 1 9 cb->data = (data == &PL_sv_undef) ? NULL : data;
504 9 0 if (cb) {
505 9 0 if (cb->func) {
509 1 8 if (cb->data) {
525 0 353 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
526 0 353 if (len == sizeof(key_name)) return 0; /* error - key_name too short*/
530 178 175 if (svtmp == NULL) {
535 0 175 if (!SvOK(*svtmp) || !SvROK(*svtmp)) return 0;
0 0 if (!SvOK(*svtmp) || !SvROK(*svtmp)) return 0;
0 0 if (!SvOK(*svtmp) || !SvROK(*svtmp)) return 0;
0 175 if (!SvOK(*svtmp) || !SvROK(*svtmp)) return 0;
545 344 9 if (data!=NULL) {
546 150 194 if (SvOK(data))
150 0 if (SvOK(data))
0 150 if (SvOK(data))
564 0 1113 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
565 0 1113 if (len == sizeof(key_name)) return &PL_sv_undef; /* return undef on error - key_name too short*/
569 3 1110 if (svtmp == NULL) return &PL_sv_undef;
570 0 1110 if (!SvOK(*svtmp)) return &PL_sv_undef;
0 0 if (!SvOK(*svtmp)) return &PL_sv_undef;
0 0 if (!SvOK(*svtmp)) return &PL_sv_undef;
571 0 1110 if (!SvROK(*svtmp)) return &PL_sv_undef;
580 480 630 if (svtmp == NULL) return &PL_sv_undef;
581 0 630 if (!SvOK(*svtmp)) return &PL_sv_undef;
0 0 if (!SvOK(*svtmp)) return &PL_sv_undef;
0 0 if (!SvOK(*svtmp)) return &PL_sv_undef;
592 0 350 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
593 0 350 if (len == sizeof(key_name)) return 0; /* error - key_name too short*/
612 3 18 if (!SvOK(cb_func)) {
3 0 if (!SvOK(cb_func)) {
3 0 if (!SvOK(cb_func)) {
617 0 21 if (!SvOK(cb_func))
0 0 if (!SvOK(cb_func))
0 0 if (!SvOK(cb_func))
625 0 21 PUSHMARK(sp);
626 0 21 EXTEND( sp, 2 );
637 0 21 if (count != 1)
640 21 0 res = POPi;
643 21 0 FREETMPS;
660 0 5 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
666 0 5 PUSHMARK(sp);
667 0 5 XPUSHs(sv_2mortal(newSViv(rwflag)));
668 0 5 XPUSHs(sv_2mortal(newSVsv(cb_data)));
675 0 5 if (count != 1)
678 5 0 res = POPp;
680 0 5 if (res == NULL) {
688 5 0 FREETMPS;
766 0 1 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
772 0 1 PUSHMARK(SP);
773 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(x509_store_ctx))));
774 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data)));
781 0 1 if (count != 1)
784 1 0 res = POPi;
787 1 0 FREETMPS;
807 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
813 0 0 PUSHMARK(SP);
814 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
815 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
822 0 0 if (count != 1)
825 0 0 res = POPi;
828 0 0 FREETMPS;
850 0 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
854 0 0 if (p) ocsp_response = d2i_OCSP_RESPONSE(NULL, &p, len);
859 0 0 PUSHMARK(SP);
860 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
862 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
866 0 0 if (ocsp_response) OCSP_RESPONSE_free(ocsp_response);
870 0 0 if (nres != 1)
873 0 0 res = POPi;
876 0 0 FREETMPS;
891 1 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 1 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
897 0 1 PUSHMARK(SP);
898 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
899 0 1 XPUSHs(sv_2mortal(newSVpvn((const char *)data, len)));
900 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data)));
907 0 1 if (nres != 1)
910 1 0 res = POPi;
913 1 0 FREETMPS;
938 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
944 0 0 PUSHMARK(SP);
946 0 0 XPUSHs(secretsv);
947 0 0 for (i=0; i
951 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)ciphers)));
952 0 0 XPUSHs(sv_2mortal(newRV_inc(pref_cipher)));
953 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
961 0 0 if (count != 1)
964 0 0 res = POPi;
965 0 0 if (res) {
967 0 0 if (SvIOK(pref_cipher))
968 0 0 *cipher = sk_SSL_CIPHER_value(peer_ciphers, SvIV(pref_cipher));
984 0 0 FREETMPS;
1012 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1018 0 0 PUSHMARK(SP);
1019 0 0 if (hint != NULL) {
1021 0 0 XPUSHs(hintsv);
1030 0 0 if (count != 2)
1033 0 0 psk_val = POPpx;
1034 0 0 identity_val = POPpx;
1036 0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
1038 0 0 if (BN_hex2bn(&psk_bn, psk_val) > 0) {
1039 0 0 if (BN_num_bytes(psk_bn) <= max_psk_len) {
1046 0 0 FREETMPS;
1072 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1078 0 0 PUSHMARK(SP);
1079 0 0 if (hint != NULL) {
1081 0 0 XPUSHs(hintsv);
1090 0 0 if (count != 2)
1093 0 0 psk_val = POPpx;
1094 0 0 identity_val = POPpx;
1096 0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
1098 0 0 if (BN_hex2bn(&psk_bn, psk_val) > 0) {
1099 0 0 if (BN_num_bytes(psk_bn) <= max_psk_len) {
1106 0 0 FREETMPS;
1120 0 8 if (last_index<0) return 0;
1121 16 8 for(i=0; i<=last_index; i++) {
1122 16 0 char *p = SvPV_nolen(*av_fetch(list, i, 0));
1124 0 16 if (len>255) return 0;
1125 8 8 if (out) {
1139 0 0 if (!list || inlen<2) return 0;
0 0 if (!list || inlen<2) return 0;
1140 0 0 while (i
1142 0 0 if (i+il > inlen) return 0;
1171 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1177 0 0 if (!next_proto_helper_protodata2AV(list, in, inlen)) return SSL_TLSEXT_ERR_ALERT_FATAL;
1181 0 0 PUSHMARK(SP);
1182 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1183 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)list)));
1184 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1188 0 0 if (count != 2)
1190 0 0 next_proto_data = (unsigned char*)POPpx;
1191 0 0 next_proto_status = POPi;
1194 0 0 if (next_proto_len<=255) {
1204 0 0 FREETMPS;
1207 0 0 return next_proto_len>255 ? SSL_TLSEXT_ERR_ALERT_FATAL : SSL_TLSEXT_ERR_OK;
1209 1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1212 0 1 if (!next_proto_data) return SSL_TLSEXT_ERR_ALERT_FATAL;
1217 0 1 if (next_proto_status != OPENSSL_NPN_NEGOTIATED) {
1243 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1248 0 0 PUSHMARK(SP);
1249 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1250 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1254 0 0 if (count != 1)
1257 0 0 if (SvOK(tmpsv) && SvROK(tmpsv) && (SvTYPE(SvRV(tmpsv)) == SVt_PVAV)) {
0 0 if (SvOK(tmpsv) && SvROK(tmpsv) && (SvTYPE(SvRV(tmpsv)) == SVt_PVAV)) {
0 0 if (SvOK(tmpsv) && SvROK(tmpsv) && (SvTYPE(SvRV(tmpsv)) == SVt_PVAV)) {
0 0 if (SvOK(tmpsv) && SvROK(tmpsv) && (SvTYPE(SvRV(tmpsv)) == SVt_PVAV)) {
0 0 if (SvOK(tmpsv) && SvROK(tmpsv) && (SvTYPE(SvRV(tmpsv)) == SVt_PVAV)) {
1261 0 0 if (protodata) next_proto_helper_AV2protodata(tmpav, protodata);
1264 0 0 FREETMPS;
1267 1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1271 1 0 if (protodata) next_proto_helper_AV2protodata(tmpav, protodata);
1273 1 0 if (protodata) {
1300 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1307 0 0 if (!next_proto_helper_protodata2AV(list, in, inlen)) return SSL_TLSEXT_ERR_ALERT_FATAL;
1311 0 0 PUSHMARK(SP);
1312 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1313 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)list)));
1314 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1318 0 0 if (count != 1)
1321 0 0 if (SvOK(alpn_data_sv)) {
0 0 if (SvOK(alpn_data_sv)) {
0 0 if (SvOK(alpn_data_sv)) {
1322 0 0 alpn_data = (unsigned char*)SvPV_nolen(alpn_data_sv);
1324 0 0 if (alpn_len <= 255) {
1334 0 0 FREETMPS;
1337 0 0 if (alpn_len>255) return SSL_TLSEXT_ERR_ALERT_FATAL;
1338 0 0 return alpn_data ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_NOACK;
1340 1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1 0 else if (SvROK(cb_data) && (SvTYPE(SvRV(cb_data)) == SVt_PVAV)) {
1345 0 1 if (!alpn_data) return SSL_TLSEXT_ERR_ALERT_FATAL;
1351 0 1 if (status != OPENSSL_NPN_NEGOTIATED) {
1355 1 0 return status == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_NOACK;
1372 2 0 if (cb->func && SvOK(cb->func)) {
0 2 if (cb->func && SvOK(cb->func)) {
0 0 if (cb->func && SvOK(cb->func)) {
0 0 if (cb->func && SvOK(cb->func)) {
1376 0 2 PUSHMARK(sp);
1378 0 2 XPUSHs(sv_2mortal( newSViv(bufsize-1) ));
1379 0 2 XPUSHs(sv_2mortal( newSViv(rwflag) ));
1380 0 2 if (cb->data) XPUSHs( cb->data );
0 0 if (cb->data) XPUSHs( cb->data );
1389 0 2 if (count != 1) {
1393 2 0 str = POPpx;
1395 2 0 if (str_len+1 < bufsize) {
1405 2 0 FREETMPS;
1418 641 0 if (cb->func && SvOK(cb->func)) {
447 194 if (cb->func && SvOK(cb->func)) {
447 0 if (cb->func && SvOK(cb->func)) {
0 447 if (cb->func && SvOK(cb->func)) {
1422 0 194 PUSHMARK(sp);
1424 0 194 XPUSHs(sv_2mortal( newSViv(i) ));
1425 0 194 XPUSHs(sv_2mortal( newSViv(n) ));
1426 60 134 if (cb->data) XPUSHs( cb->data );
0 60 if (cb->data) XPUSHs( cb->data );
1432 0 193 if (count != 0)
1437 193 0 FREETMPS;
1450 16 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 16 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1456 0 16 PUSHMARK(SP);
1457 0 16 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1458 0 16 XPUSHs(sv_2mortal(newSViv(where)) );
1459 0 16 XPUSHs(sv_2mortal(newSViv(ret)) );
1460 0 16 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1467 16 0 FREETMPS;
1480 457 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 457 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1486 0 457 PUSHMARK(SP);
1487 0 457 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1488 0 457 XPUSHs(sv_2mortal(newSViv(where)) );
1489 0 457 XPUSHs(sv_2mortal(newSViv(ret)) );
1490 0 457 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1497 457 0 FREETMPS;
1509 24 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 24 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1515 0 24 PUSHMARK(SP);
1516 0 24 XPUSHs(sv_2mortal(newSViv(write_p)));
1517 0 24 XPUSHs(sv_2mortal(newSViv(version)));
1518 0 24 XPUSHs(sv_2mortal(newSViv(content_type)));
1519 0 24 XPUSHs(sv_2mortal(newSVpv((const char*)buf, len)));
1520 0 24 XPUSHs(sv_2mortal(newSViv(len)));
1521 0 24 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1522 0 24 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1529 24 0 FREETMPS;
1542 24 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 24 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1548 0 24 PUSHMARK(SP);
1549 0 24 XPUSHs(sv_2mortal(newSViv(write_p)));
1550 0 24 XPUSHs(sv_2mortal(newSViv(version)));
1551 0 24 XPUSHs(sv_2mortal(newSViv(content_type)));
1552 0 24 XPUSHs(sv_2mortal(newSVpv((const char*)buf, len)));
1553 0 24 XPUSHs(sv_2mortal(newSViv(len)));
1554 0 24 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1555 0 24 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1562 24 0 FREETMPS;
1595 7 0 if (!SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 7 if (!SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1600 0 7 PUSHMARK(SP);
1602 0 7 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1604 4 3 if (!enc) {
1606 0 4 XPUSHs(sv_2mortal(newSVpv((const char *)key_name,16)));
1617 0 7 if (count>2)
1621 6 1 if (count>0) {
1623 0 6 if (SvOK(sname)) {
0 0 if (SvOK(sname)) {
0 0 if (SvOK(sname)) {
1624 6 0 unsigned char *pname = (unsigned char *)SvPV(sname,svlen);
1625 0 6 if (svlen > 16)
1627 0 6 if (svlen == 0)
1634 6 1 if (count>1) {
1636 0 6 if (SvOK(skey)) {
0 0 if (SvOK(skey)) {
0 0 if (SvOK(skey)) {
1637 6 0 unsigned char *pkey = (unsigned char *)SvPV(skey,svlen);
1638 0 6 if (svlen != 32 && svlen != 48)
0 0 if (svlen != 32 && svlen != 48)
1647 7 0 FREETMPS;
1650 4 3 if (!enc && usable_rv_count == 0) {
1 3 if (!enc && usable_rv_count == 0) {
1654 0 6 if (usable_rv_count != 2)
1657 3 3 if (enc) {
1669 2 1 if (memcmp(name,key_name,16) == 0)
1689 0 6 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1695 0 6 PUSHMARK(sp);
1696 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1697 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(sess))));
1704 0 6 if (count != 1)
1707 6 0 remove = POPi;
1710 6 0 FREETMPS;
1724 0 6 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1730 0 6 PUSHMARK(sp);
1731 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(ctx))));
1732 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(sess))));
1740 6 0 FREETMPS;
1822 0 0 if (asn1t->type == V_ASN1_UTCTIME) {
1823 0 0 if (asn1t->length<12 || asn1t->length>17) return 0;
0 0 if (asn1t->length<12 || asn1t->length>17) return 0;
1824 0 0 if (asn1t->length>12) tz = 12;
1826 0 0 if (asn1t->length<14) return 0;
1827 0 0 if (asn1t->length>14) {
1828 0 0 if (p[14] == '.') {
1830 0 0 for(i=msec+1;ilength && p[i]>='0' && p[i]<='9';i++) ;
0 0 for(i=msec+1;ilength && p[i]>='0' && p[i]<='9';i++) ;
0 0 for(i=msec+1;ilength && p[i]>='0' && p[i]<='9';i++) ;
1831 0 0 if (ilength) tz = i;
1838 0 0 l = msec ? msec : tz ? tz : asn1t->length;
0 0 l = msec ? msec : tz ? tz : asn1t->length;
1839 0 0 for(i=0;i
1840 0 0 if (p[i]<'0' || p[i]>'9') return 0;
0 0 if (p[i]<'0' || p[i]>'9') return 0;
1845 0 0 if (asn1t->type == V_ASN1_UTCTIME) { /* YY - two digit year */
1847 0 0 if (t.tm_year < 70) t.tm_year += 100;
1862 0 0 if (tz) {
1864 0 0 if (p[tz] == 'Z') {
1865 0 0 if (asn1t->length>tz+1 ) return 0;
1866 0 0 } else if (asn1t->length
0 0 } else if (asn1t->length
0 0 } else if (asn1t->length
1869 0 0 if (asn1t->length>tz+5 ) return 0;
1870 0 0 for(i=tz+1;i
1871 0 0 if (p[i]<'0' || p[i]>'9') return 0;
0 0 if (p[i]<'0' || p[i]>'9') return 0;
1875 0 0 if (p[tz]=='+') adj*= -1; /* +0500: subtract 5 hours to get UTC */
1880 0 0 if (result == -1) return 0; /* broken time */
1882 0 0 if (gmtoff && *gmtoff == -1) {
0 0 if (gmtoff && *gmtoff == -1) {
1896 0 0 if (chain) {
1897 0 0 for(i=0;i
1898 0 0 if ( X509_check_issued(sk_X509_value(chain,i),cert) == X509_V_OK ) {
1905 0 0 if ( !issuer && store ) {
0 0 if ( !issuer && store ) {
1907 0 0 if (stx && X509_STORE_CTX_init(stx,store,cert,NULL)) {
0 0 if (stx && X509_STORE_CTX_init(stx,store,cert,NULL)) {
1909 0 0 if (ok<0) {
1911 0 0 if(err) {
1916 0 0 } else if (ok == 0 ) {
1922 0 0 if (stx) X509_STORE_CTX_free(stx);
1931 8 0 : &PL_sv_undef;
2168 7 0 RETVAL = SSL_CTX_load_verify_locations (ctx,
7 0 RETVAL = SSL_CTX_load_verify_locations (ctx,
2169 7 0 CAfile?(*CAfile?CAfile:NULL):NULL,
2170 0 7 CApath?(*CApath?CApath:NULL):NULL
2189 1 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
1 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 0 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
0 1 if (callback==NULL || !SvOK(callback) || !SvTRUE(callback)) {
2236 6 0 if (callback==NULL || !SvOK(callback)) {
0 6 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
2250 6 0 if (callback==NULL || !SvOK(callback)) {
0 6 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
2361 18 288 if (got <= 0 && SSL_ERROR_ZERO_RETURN != SSL_get_error(s, got))
6 12 if (got <= 0 && SSL_ERROR_ZERO_RETURN != SSL_get_error(s, got))
2368 306 0 if (GIMME_V==G_LIST) {
286 20 if (GIMME_V==G_LIST) {
2369 0 286 EXTEND(SP, 2);
2370 281 5 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2375 0 20 EXTEND(SP, 1);
2376 19 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2393 2 3 if (got <= 0 && SSL_ERROR_ZERO_RETURN != SSL_get_error(s, got))
2 0 if (got <= 0 && SSL_ERROR_ZERO_RETURN != SSL_get_error(s, got))
2400 5 0 if (GIMME_V==G_LIST) {
2 3 if (GIMME_V==G_LIST) {
2401 0 2 EXTEND(SP, 2);
2402 1 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2407 0 3 EXTEND(SP, 1);
2408 2 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2517 0 22 if (len < 0) {
2670 2 2 if( sk == NULL ) {
2673 194 2 for (i=0; i
2675 0 194 XPUSHs(sv_2mortal(newSViv(PTR2IV(c))));
2701 7 0 if(SSL_get_shared_ciphers(s, buf, sizeof(buf)))
2717 0 0 if( chain == NULL ) {
2720 0 0 for (i=0; i
2722 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(x))));
2731 7 0 if (callback==NULL || !SvOK(callback)) {
0 7 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
2794 0 3 if (!(len = i2d_SSL_SESSION(sess,NULL))) croak("invalid SSL_SESSION");
2796 0 3 if (!pc) croak("out of memory");
2799 0 3 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
2808 7 0 if (SvPOK(pv)) {
2811 7 0 p = (unsigned char*)SvPV(pv,len);
3083 0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
3233 43 1 if (!LIB_initialized) {
3331 0 0 RAND_add((const void *)SvPV(buf, len), num, entropy);
3346 0 3 if (!RAND_file_name(buf, num)) {
3385 0 0 RETVAL = X509_check_host(cert, name, 0, flags, (items == 4) ? &c_peername : NULL);
3386 0 0 if (items == 4)
3391 0 0 if (c_peername)
3407 0 0 c_address = (unsigned char *)SvPV(address, addresslen);
3514 17 0 if ((buf = X509_NAME_oneline(name, NULL, 0))) {
3531 13 0 if (bp) {
3532 13 0 if (X509_NAME_print_ex(bp, name, ident, flags)) {
3535 13 0 if (buf) {
3537 13 0 if (i>=0 && i<=n) {
13 0 if (i>=0 && i<=n) {
3539 0 13 if (utf8_decode) sv_utf8_decode(ST(0));
3558 1 0 if (length>=0) {
3560 1 0 if (X509_NAME_get_text_by_NID(name, nid, buf, length + 1)>=0)
3720 1 0 if (crl && crl_number)
1 0 if (crl && crl_number)
3721 1 0 if (X509_CRL_add1_ext_i2d(crl, NID_crl_number, crl_number, 0, 0)) RETVAL = 1;
3732 1 0 if (!RETVAL || i==-1) XSRETURN_UNDEF;
0 1 if (!RETVAL || i==-1) XSRETURN_UNDEF;
3752 2 0 if (rev) {
3753 2 0 if (BN_hex2bn(&bn, serial_hex)) {
3755 2 0 if (sn) {
3763 0 2 if (!rv) XSRETURN_IV(0);
3765 0 2 if (!rev_time) XSRETURN_IV(0);
3766 0 2 if (!X509_REVOKED_set_revocationDate(rev, rev_time)) XSRETURN_IV(0);
3768 2 0 if(reason_code) {
3771 2 0 if (rsn) {
3772 2 0 if (ASN1_ENUMERATED_set(rsn, reason_code))
3773 2 0 if (X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rsn, 0, 0))
3777 0 2 if (!rv) XSRETURN_IV(0);
3780 2 0 if(comp_time) {
3784 0 2 if(!X509_CRL_add0_revoked(crl, rev)) XSRETURN_IV(0);
3857 1 1 for (i=0; i
3860 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(s))));
3875 1 0 if (items>1) {
3878 6 1 while(i+1
3879 6 0 nid = SvIV(ST(i));
3880 6 0 data = SvPV_nolen(ST(i+1));
3883 6 0 if (ex)
3907 1 0 if (items>1) {
3909 6 1 while(i+1
3910 6 0 nid = SvIV(ST(i));
3911 6 0 data = SvPV_nolen(ST(i+1));
3915 6 0 if (ex) {
3942 1 0 if (items>1) {
3944 1 1 while(i+1
3945 1 0 nid = SvIV(ST(i));
3946 1 0 data = SvPV_nolen(ST(i+1));
3950 1 0 if (ex) {
3977 1 0 if (!x509 || !x509_req) XSRETURN_IV(0);
0 1 if (!x509 || !x509_req) XSRETURN_IV(0);
3979 6 1 for(i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
3984 0 6 if (idx != -1) {
3985 0 0 if (override) continue; /* don't override existing extension */
3992 0 0 } while (idx != -1);
3994 0 6 if (!X509_add_ext(x509, ext, -1)) ret = 0;
4048 9 0 if (!k && !strcmp(type,"md5")) {
4 5 if (!k && !strcmp(type,"md5")) {
4052 5 4 if (!k && !strcmp(type,"sha1")) {
4 1 if (!k && !strcmp(type,"sha1")) {
4057 1 8 if (!k && !strcmp(type,"sha256")) {
0 1 if (!k && !strcmp(type,"sha256")) {
4062 1 8 if (!k && !strcmp(type,"ripemd160")) {
0 1 if (!k && !strcmp(type,"ripemd160")) {
4065 1 8 if (!k) /* Default digest */
4067 0 9 if ( digest_tp == NULL ) {
4071 0 9 if (!X509_digest(cert, digest_tp, digest, &dsz)) {
4076 164 9 for(k=0; k
4092 3 2 if ( (i = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1)) >= 0
4093 3 0 && (subjAltNameExt = X509_get_ext(cert, i))
4094 3 0 && (subjAltNameDNs = X509V3_EXT_d2i(subjAltNameExt)))
4098 16 3 for (j = 0; j < num_gnames; j++)
4105 0 2 EXTEND(SP, 2);
4118 0 8 EXTEND(SP, 2);
4131 0 0 EXTEND(SP, 2);
4142 2 0 if (len < 0 || len > (int)((sizeof(buf) - 1)))
2 0 if (len < 0 || len > (int)((sizeof(buf) - 1)))
4144 0 2 EXTEND(SP, 2);
4152 0 4 EXTEND(SP, 2);
4177 2 4 for (i = 0; i < sk_DIST_POINT_num(points); i++) {
4179 0 2 if (!p->distpoint)
4181 2 0 if (p->distpoint->type == 0) {
4184 2 2 for (j = 0; j < sk_GENERAL_NAME_num(gnames); j++) {
4187 2 0 if (gn->type == GEN_URI) {
4191 0 2 XPUSHs(sv_2mortal(newSVpv((char*)ASN1_STRING_data(gn->d.ia5),ASN1_STRING_length(gn->d.ia5))));
4228 0 0 if (!info) XSRETURN_UNDEF;
4230 0 0 for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
4232 0 0 if (OBJ_obj2nid(ad->method) == NID_ad_OCSP
4233 0 0 && ad->location->type == GEN_URI) {
4240 0 0 XPUSHs(sv_2mortal(newSVpv(
4245 0 0 if (GIMME == G_SCALAR) break; /* get only first */
0 0 if (GIMME == G_SCALAR) break; /* get only first */
4262 76 16 for(i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
4266 19 57 if(format==0)
4267 0 19 XPUSHs(sv_2mortal(newSVpv(buffer,0))); /* format 0: oid */
4268 19 38 else if(format==1 && nid>0)
16 3 else if(format==1 && nid>0)
4269 0 16 XPUSHs(sv_2mortal(newSViv(nid))); /* format 1: nid */
4270 19 22 else if(format==2 && nid>0)
16 3 else if(format==2 && nid>0)
4271 0 16 XPUSHs(sv_2mortal(newSVpv(OBJ_nid2sn(nid),0))); /* format 2: shortname */
4272 19 6 else if(format==3 && nid>0)
16 3 else if(format==3 && nid>0)
4273 0 16 XPUSHs(sv_2mortal(newSVpv(OBJ_nid2ln(nid),0))); /* format 3: longname */
4286 4 0 if (u) {
4287 4 0 if (ASN1_BIT_STRING_get_bit(u,0)) XPUSHs(sv_2mortal(newSVpv("digitalSignature",0)));
0 4 if (ASN1_BIT_STRING_get_bit(u,0)) XPUSHs(sv_2mortal(newSVpv("digitalSignature",0)));
4288 1 3 if (ASN1_BIT_STRING_get_bit(u,1)) XPUSHs(sv_2mortal(newSVpv("nonRepudiation",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,1)) XPUSHs(sv_2mortal(newSVpv("nonRepudiation",0)));
4289 4 0 if (ASN1_BIT_STRING_get_bit(u,2)) XPUSHs(sv_2mortal(newSVpv("keyEncipherment",0)));
0 4 if (ASN1_BIT_STRING_get_bit(u,2)) XPUSHs(sv_2mortal(newSVpv("keyEncipherment",0)));
4290 1 3 if (ASN1_BIT_STRING_get_bit(u,3)) XPUSHs(sv_2mortal(newSVpv("dataEncipherment",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,3)) XPUSHs(sv_2mortal(newSVpv("dataEncipherment",0)));
4291 1 3 if (ASN1_BIT_STRING_get_bit(u,4)) XPUSHs(sv_2mortal(newSVpv("keyAgreement",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,4)) XPUSHs(sv_2mortal(newSVpv("keyAgreement",0)));
4292 1 3 if (ASN1_BIT_STRING_get_bit(u,5)) XPUSHs(sv_2mortal(newSVpv("keyCertSign",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,5)) XPUSHs(sv_2mortal(newSVpv("keyCertSign",0)));
4293 1 3 if (ASN1_BIT_STRING_get_bit(u,6)) XPUSHs(sv_2mortal(newSVpv("cRLSign",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,6)) XPUSHs(sv_2mortal(newSVpv("cRLSign",0)));
4294 0 4 if (ASN1_BIT_STRING_get_bit(u,7)) XPUSHs(sv_2mortal(newSVpv("encipherOnly",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,7)) XPUSHs(sv_2mortal(newSVpv("encipherOnly",0)));
4295 1 3 if (ASN1_BIT_STRING_get_bit(u,8)) XPUSHs(sv_2mortal(newSVpv("decipherOnly",0)));
0 1 if (ASN1_BIT_STRING_get_bit(u,8)) XPUSHs(sv_2mortal(newSVpv("decipherOnly",0)));
4306 0 4 if (u) {
4307 0 0 if (ASN1_BIT_STRING_get_bit(u,0)) XPUSHs(sv_2mortal(newSVpv("client",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,0)) XPUSHs(sv_2mortal(newSVpv("client",0)));
4308 0 0 if (ASN1_BIT_STRING_get_bit(u,1)) XPUSHs(sv_2mortal(newSVpv("server",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,1)) XPUSHs(sv_2mortal(newSVpv("server",0)));
4309 0 0 if (ASN1_BIT_STRING_get_bit(u,2)) XPUSHs(sv_2mortal(newSVpv("email",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,2)) XPUSHs(sv_2mortal(newSVpv("email",0)));
4310 0 0 if (ASN1_BIT_STRING_get_bit(u,3)) XPUSHs(sv_2mortal(newSVpv("objsign",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,3)) XPUSHs(sv_2mortal(newSVpv("objsign",0)));
4311 0 0 if (ASN1_BIT_STRING_get_bit(u,4)) XPUSHs(sv_2mortal(newSVpv("reserved",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,4)) XPUSHs(sv_2mortal(newSVpv("reserved",0)));
4312 0 0 if (ASN1_BIT_STRING_get_bit(u,5)) XPUSHs(sv_2mortal(newSVpv("sslCA",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,5)) XPUSHs(sv_2mortal(newSVpv("sslCA",0)));
4313 0 0 if (ASN1_BIT_STRING_get_bit(u,6)) XPUSHs(sv_2mortal(newSVpv("emailCA",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,6)) XPUSHs(sv_2mortal(newSVpv("emailCA",0)));
4314 0 0 if (ASN1_BIT_STRING_get_bit(u,7)) XPUSHs(sv_2mortal(newSVpv("objCA",0)));
0 0 if (ASN1_BIT_STRING_get_bit(u,7)) XPUSHs(sv_2mortal(newSVpv("objCA",0)));
4368 21 0 if (bp) {
4369 21 0 if(X509V3_EXT_print(bp,ext,flags,indent)) {
4372 21 0 if (buf) {
4374 21 0 if (i>=0 && i<=n) {
21 0 if (i>=0 && i<=n) {
4376 0 21 if (utf8_decode) sv_utf8_decode(ST(0));
4537 0 3 if (!BN_hex2bn(&bn, str)) XSRETURN_IV(0);
4538 0 3 if (!BN_to_ASN1_INTEGER(bn, i)) rv = 0;
4551 0 1 if (!BN_dec2bn(&bn, str)) XSRETURN_IV(0);
4552 0 1 if (!BN_to_ASN1_INTEGER(bn, i)) rv = 0;
4564 0 6 if (!bn) XSRETURN_UNDEF;
4568 0 6 if (!result) XSRETURN_UNDEF;
4569 0 6 XPUSHs(sv_2mortal(newSVpv((const char*)result, strlen(result))));
4580 0 5 if (!bn) XSRETURN_UNDEF;
4584 0 5 if (!result) XSRETURN_UNDEF;
4585 0 5 XPUSHs(sv_2mortal(newSVpv((const char*)result, strlen(result))));
4600 43 44 if (utf8_decode) sv_utf8_decode(u8);
4601 0 87 XPUSHs(sv_2mortal(u8));
4673 4 0 if (tm) {
4675 4 0 if (bp) {
4679 4 0 if (i>0)
4698 34 0 if (tmp) {
4699 34 0 if (ASN1_GENERALIZEDTIME_check(tmp)) {
4700 34 0 if (strlen((char*)tmp->data)>=14 && strlen((char*)tmp->data)<200) {
34 0 if (strlen((char*)tmp->data)>=14 && strlen((char*)tmp->data)<200) {
4708 34 0 if (strlen((char*)tmp->data)>14) strcat(buf+19,(char*)tmp->data+14);
4725 0 13 if (!tm) XSRETURN_UNDEF;
4727 0 13 if (strlen(str) < 19) XSRETURN_UNDEF;
4728 52 0 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 52 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
52 13 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4729 26 0 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 26 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
26 13 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4730 26 0 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 26 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
26 13 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4731 26 0 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 26 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
26 13 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4732 26 0 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 26 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
26 13 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4733 26 0 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 26 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
26 13 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4741 13 0 if (strlen(str)>19 && strlen(str)<200) strcat(buf,str+19);
13 0 if (strlen(str)>19 && strlen(str)<200) strcat(buf,str+19);
4749 13 0 if (!ASN1_TIME_check(&t)) {
4751 0 13 if (!ASN1_TIME_check(&t)) XSRETURN_UNDEF;
4755 0 13 if (!ASN1_STRING_set(tm,t.data,t.length)) XSRETURN_UNDEF;
4809 3 0 if (bp && x509) {
3 0 if (bp && x509) {
4813 3 0 if (buf) {
4815 3 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
3 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
4831 1 0 if (bp && x509_req) {
1 0 if (bp && x509_req) {
4835 1 0 if (buf) {
4837 1 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
1 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
4853 1 0 if (bp && x509_crl) {
1 0 if (bp && x509_crl) {
4857 1 0 if (buf) {
4859 1 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
1 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
4880 6 0 if (bp && pk) {
6 0 if (bp && pk) {
4881 2 4 if (passwd) passwd_len = strlen(passwd);
4882 2 4 if (passwd_len>0) {
4884 1 1 if (!enc_alg)
4895 6 0 if (buf) {
4897 6 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
6 0 if (i>=0 && i<=n) sv_setpvn(ST(0), buf, i);
4916 0 0 if (bio) {
4922 0 0 if ((p12 = d2i_PKCS12_bio(bio, NULL))) {
4923 0 0 if (PKCS12_parse(p12, password, &private_key, &certificate, NULL)) {
4924 0 0 if (private_key) {
4925 0 0 if (SSL_CTX_use_PrivateKey(ctx, private_key)) RETVAL = 1;
4928 0 0 if (certificate) {
4929 0 0 if (SSL_CTX_use_certificate(ctx, certificate)) RETVAL = 1;
4935 0 0 if (!RETVAL) ERR_print_errors_fp(stderr);
4956 4 0 if (bio) {
4962 4 0 if ((p12 = d2i_PKCS12_bio(bio, NULL))) {
4963 3 1 if(load_chain)
4967 4 0 if (result) {
4968 4 0 if (private_key)
4969 0 4 XPUSHs(sv_2mortal(newSViv(PTR2IV(private_key))));
4971 0 0 XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef */
4972 4 0 if (certificate)
4973 0 4 XPUSHs(sv_2mortal(newSViv(PTR2IV(certificate))));
4975 0 0 XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef */
4976 1 3 if (cachain) {
4977 2 1 for (i=0; i
4979 0 2 XPUSHs(sv_2mortal(newSViv(PTR2IV(x))));
5019 9 0 if (MD4(data,len,md)) {
5037 9 0 if (MD5(data,len,md)) {
5055 9 0 if (RIPEMD160(data,len,md)) {
5073 8 0 if (SHA1(data,len,md)) {
5090 8 0 if (SHA256(data,len,md)) {
5107 8 0 if (SHA512(data,len,md)) {
5298 55 83 if ((got = BIO_read(s, buf, max)) >= 0)
5375 0 194 if(description == NULL) {
5378 0 194 XPUSHs(sv_2mortal(newSVpv(description, 0)));
5389 0 390 if (items > 2) croak("SSL_CIPHER_get_bits: Need to call with one or two parameters");
5390 194 196 if (items > 1) sv_setsv(ST(1), sv_2mortal(newSViv(alg_bits)));
5457 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
5486 4 0 if (callback==NULL || !SvOK(callback)) {
0 4 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
5503 2 0 if (data==NULL || !SvOK(data)) {
0 2 if (data==NULL || !SvOK(data)) {
0 0 if (data==NULL || !SvOK(data)) {
0 0 if (data==NULL || !SvOK(data)) {
5619 3 1 if (count > finished_len)
5638 3 1 if (count > finished_len)
5756 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
5772 148 0 if (callback==NULL || !SvOK(callback)) {
0 148 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
5788 2 0 if (callback==NULL || !SvOK(callback)) {
1 1 if (callback==NULL || !SvOK(callback)) {
1 0 if (callback==NULL || !SvOK(callback)) {
1 0 if (callback==NULL || !SvOK(callback)) {
5804 2 0 if (callback==NULL || !SvOK(callback)) {
1 1 if (callback==NULL || !SvOK(callback)) {
1 0 if (callback==NULL || !SvOK(callback)) {
1 0 if (callback==NULL || !SvOK(callback)) {
6119 0 1 if (SvIOK(curve)) {
6120 0 0 nid = SvIV(curve);
6122 1 0 nid = OBJ_sn2nid(SvPV_nolen(curve));
6124 0 1 if (!nid) nid = EC_curve_nist2nid(SvPV_nolen(curve));
0 0 if (!nid) nid = EC_curve_nist2nid(SvPV_nolen(curve));
6126 0 1 if (!nid) croak("unknown curve %s",SvPV_nolen(curve));
0 0 if (!nid) croak("unknown curve %s",SvPV_nolen(curve));
6130 0 1 if (!group) croak("unknown curve nid=%d",nid);
6134 1 0 if ( eckey
6135 1 0 && EC_KEY_set_group(eckey, group)
6136 1 0 && EC_KEY_generate_key(eckey)) {
6139 0 0 if (eckey) EC_KEY_free(eckey);
6141 1 0 if (group) EC_GROUP_free(group);
6354 0 8 if(!e)
6360 0 8 if(!ret) {
6382 7 0 if (rc == -1 || ret == NULL) {
0 7 if (rc == -1 || ret == NULL) {
6383 0 0 if (ret) RSA_free(ret);
6436 0 1 XPUSHs(bn2sv(rsa->n));
6437 0 1 XPUSHs(bn2sv(rsa->e));
6438 0 1 XPUSHs(bn2sv(rsa->d));
6439 0 1 XPUSHs(bn2sv(rsa->p));
6440 0 1 XPUSHs(bn2sv(rsa->q));
6441 0 1 XPUSHs(bn2sv(rsa->dmp1));
6442 0 1 XPUSHs(bn2sv(rsa->dmq1));
6443 0 1 XPUSHs(bn2sv(rsa->iqmp));
6569 6 2 if (SvOK(perl_cb)) {
6 0 if (SvOK(perl_cb)) {
0 6 if (SvOK(perl_cb)) {
6575 6 0 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
6 0 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
6 0 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
4 2 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
0 4 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
2 0 else if (!SvOK(perl_cb) && SvOK(perl_data) && SvPOK(perl_data)) {
6579 4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
4 0 else if (!SvOK(perl_cb) && !SvOK(perl_data)) {
6732 1 0 if (s == NULL ||
1 0 if (s == NULL ||
6733 1 0 s->enc_read_ctx == NULL ||
6734 0 1 s->enc_read_ctx->cipher == NULL ||
6752 1 0 if (s->s3)
6765 1 0 : -1;
6782 0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
6802 0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
6816 0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
6835 3 0 if (callback==NULL || !SvOK(callback)) {
0 3 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
6929 57 0 if (EVP_DigestFinal(ctx,md,&md_size))
6941 9 0 if (EVP_DigestFinal_ex(ctx,md,&md_size))
6957 48 0 if (EVP_Digest(data,len,md,&md_size,type,impl))
7279 4 0 if (X509_pubkey_digest(data,type,md,&md_size))
7294 4 0 if (X509_digest(data,type,md,&md_size))
7306 1 0 if (X509_CRL_digest(data,type,md,&md_size))
7318 1 0 if (X509_REQ_digest(data,type,md,&md_size))
7330 0 0 if (X509_NAME_digest(data,type,md,&md_size))
7379 0 1 if (!(pkey = X509_get_X509_PUBKEY(x))) croak("invalid certificate");
7380 0 1 if (!(len = i2d_X509_PUBKEY(pkey, NULL))) croak("invalid certificate public key");
7382 0 1 if (!pc) croak("out of memory");
7385 0 1 if (pi-pc != len) croak("invalid encoded length");
7386 0 1 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7398 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
7404 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7411 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7430 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
7436 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7443 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7463 0 2 XPUSHs(sv_2mortal(newSVpv((char *)data, len)));
7469 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data_advanced_get((void*)s, "next_proto_select_cb!!last_status"))));
7503 0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
7507 0 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7524 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
7528 1 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
1 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7548 1 0 if (ticketlen > 0) {
7550 0 1 if (!p)
7566 0 0 if (SvPOK(pv)) {
7569 0 0 p = (unsigned char*)SvPV(pv,len);
7581 0 0 if (!(len = i2d_OCSP_RESPONSE(r,NULL))) croak("invalid OCSP response");
7583 0 0 if (!pc) croak("out of memory");
7586 0 0 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7599 0 0 if (SvPOK(pv)) {
7602 0 0 p = (unsigned char*)SvPV(pv,len);
7614 0 0 if (!(len = i2d_OCSP_REQUEST(r,NULL))) croak("invalid OCSP request");
7616 0 0 if (!pc) croak("out of memory");
7619 0 0 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7647 0 0 if (!ssl) croak("not a SSL object");
7649 0 0 if (!ctx) croak("invalid SSL object - no context");
7653 0 0 for(i=0;i
7654 0 0 cert = INT2PTR(X509*,SvIV(ST(i+1)));
7655 0 0 if (X509_check_issued(cert,cert) == X509_V_OK)
7657 0 0 if (!(issuer = find_issuer(cert,store,chain)))
7661 0 0 if (!id)
7665 0 0 if (!(len = i2d_OCSP_CERTID(id,&pi)))
7667 0 0 XPUSHs(sv_2mortal(newSVpvn((char *)pi, len)));
7682 0 0 if (!req) croak("out of memory");
7685 0 0 for(i=0;i
7687 0 0 const unsigned char *p = (unsigned char*)SvPV(ST(i),len);
7689 0 0 if (!id) {
7714 0 0 if (!ssl) croak("not a SSL object");
7716 0 0 if (!ctx) croak("invalid SSL object - no context");
7719 0 0 if (!bsr) croak("invalid OCSP response");
7723 0 0 if (svreq && SvOK(svreq) &&
0 0 if (svreq && SvOK(svreq) &&
0 0 if (svreq && SvOK(svreq) &&
0 0 if (svreq && SvOK(svreq) &&
0 0 if (svreq && SvOK(svreq) &&
7724 0 0 (req = INT2PTR(OCSP_REQUEST*,SvIV(svreq)))) {
7726 0 0 if ( i <= 0 ) {
7727 0 0 if (i == -1) {
7737 0 0 if ((store = SSL_CTX_get_cert_store(ctx))) {
7742 0 0 for(i=0;i
7747 0 0 if (chain && !RETVAL) {
0 0 if (chain && !RETVAL) {
7755 0 0 if (last && (issuer = find_issuer(last,store,chain))) {
0 0 if (last && (issuer = find_issuer(last,store,chain))) {
7779 0 0 if (!bsr) croak("invalid OCSP response");
7781 0 0 want_array = (GIMME == G_LIST);
7785 0 0 for(i=0; i < (getall ? sksn : items-1); i++) {
0 0 for(i=0; i < (getall ? sksn : items-1); i++) {
7793 0 0 if(getall) {
7800 0 0 if (!SvOK(idsv)) croak("undefined certid in arguments");
0 0 if (!SvOK(idsv)) croak("undefined certid in arguments");
0 0 if (!SvOK(idsv)) croak("undefined certid in arguments");
7801 0 0 p = (unsigned char*)SvPV(idsv,len);
7802 0 0 if (!(certid = d2i_OCSP_CERTID(NULL,&p,len))) {
7807 0 0 if (first >= 0)
7811 0 0 if (sir)
7817 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED)
7822 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED) {
7824 0 0 } else if (status != V_OCSP_CERTSTATUS_GOOD) {
7827 0 0 else if (!OCSP_check_validity(thisupdate, nextupdate, 0, -1)) {
7835 0 0 if (want_array) {
7837 0 0 if (!idsv) {
7845 0 0 if(!len) continue;
7847 0 0 if (!pc) croak("out of memory");
7861 0 0 av_push(idav, error ? newSVpv(error,0) : newSV(0));
7862 0 0 if (sir) {
7867 0 0 if (nextupdate) hv_store(details,"nextUpdate",10,
7869 0 0 if (thisupdate) hv_store(details,"thisUpdate",10,
7871 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED) {
7882 0 0 XPUSHs(sv_2mortal(newRV_noinc((SV*)idav)));
7883 0 0 } else if (!error) {
7886 0 0 if (!nextupd || nextupd>nu) nextupd = nu;
0 0 if (!nextupd || nextupd>nu) nextupd = nu;
7889 0 0 if (certid) OCSP_CERTID_free(certid);
7890 0 0 if (error && !want_array) {
0 0 if (error && !want_array) {
7896 0 0 if (!want_array)
7897 0 0 XPUSHs(sv_2mortal(newSViv(nextupd)));
7912 1 0 if (callback==NULL || !SvOK(callback)) {
0 1 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
0 0 if (callback==NULL || !SvOK(callback)) {
7918 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7925 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7948 1 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
0 1 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
7952 0 1 if (!alpn_data)
7972 0 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
0 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
7976 0 0 if (!alpn_data)
7993 0 2 XPUSHs(sv_2mortal(newSVpv((char *)data, len)));
8016 9 6 if (context != &PL_sv_undef) {
8018 9 0 context_arg = SvPV( ST(3), contextlen);
8021 15 0 PUSHs(sv_2mortal(ret>0 ? newSVpvn((const char *)out, outlen) : newSV(0)));
8022 0 15 EXTEND(SP, 1);