Branch Coverage

SSLeay.xs
Criterion Covered Total %
branch 623 1808 34.4


line true false branch
236 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) {
424 50 39 if (!m) return; /* Skip aliases */
426 18 21 if (strcmp(from, mname)) return; /* Skip shortnames */
428 5 16 if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST) return; /* Skip clones */
430 0 16 if (strchr(mname, ' ')) mname= EVP_MD_name(m);
486 10 0 if (cb) {
490 1 9 cb->data = (data == &PL_sv_undef) ? NULL : data;
497 9 0 if (cb) {
498 9 0 if (cb->func) {
502 1 8 if (cb->data) {
518 0 353 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
519 0 353 if (len == sizeof(key_name)) return 0; /* error - key_name too short*/
523 178 175 if (svtmp == NULL) {
528 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;
538 344 9 if (data!=NULL) {
539 150 194 if (SvOK(data))
150 0 if (SvOK(data))
0 150 if (SvOK(data))
557 0 1113 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
558 0 1113 if (len == sizeof(key_name)) return &PL_sv_undef; /* return undef on error - key_name too short*/
562 3 1110 if (svtmp == NULL) return &PL_sv_undef;
563 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;
564 0 1110 if (!SvROK(*svtmp)) return &PL_sv_undef;
573 480 630 if (svtmp == NULL) return &PL_sv_undef;
574 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;
585 0 350 len = my_snprintf(key_name, sizeof(key_name), "ptr_%p", ptr);
586 0 350 if (len == sizeof(key_name)) return 0; /* error - key_name too short*/
605 3 18 if (!SvOK(cb_func)) {
3 0 if (!SvOK(cb_func)) {
3 0 if (!SvOK(cb_func)) {
610 0 21 if (!SvOK(cb_func))
0 0 if (!SvOK(cb_func))
0 0 if (!SvOK(cb_func))
618 0 21 PUSHMARK(sp);
619 0 21 EXTEND( sp, 2 );
630 0 21 if (count != 1)
633 21 0 res = POPi;
636 21 0 FREETMPS;
653 0 5 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
659 0 5 PUSHMARK(sp);
660 0 5 XPUSHs(sv_2mortal(newSViv(rwflag)));
661 0 5 XPUSHs(sv_2mortal(newSVsv(cb_data)));
668 0 5 if (count != 1)
671 5 0 res = POPp;
673 0 5 if (res == NULL) {
681 5 0 FREETMPS;
759 0 1 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
765 0 1 PUSHMARK(SP);
766 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(x509_store_ctx))));
767 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data)));
774 0 1 if (count != 1)
777 1 0 res = POPi;
780 1 0 FREETMPS;
800 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
806 0 0 PUSHMARK(SP);
807 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
808 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
815 0 0 if (count != 1)
818 0 0 res = POPi;
821 0 0 FREETMPS;
843 0 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
847 0 0 if (p) ocsp_response = d2i_OCSP_RESPONSE(NULL, &p, len);
852 0 0 PUSHMARK(SP);
853 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
855 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
859 0 0 if (ocsp_response) OCSP_RESPONSE_free(ocsp_response);
863 0 0 if (nres != 1)
866 0 0 res = POPi;
869 0 0 FREETMPS;
884 1 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 1 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
890 0 1 PUSHMARK(SP);
891 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
892 0 1 XPUSHs(sv_2mortal(newSVpvn((const char *)data, len)));
893 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data)));
900 0 1 if (nres != 1)
903 1 0 res = POPi;
906 1 0 FREETMPS;
931 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
937 0 0 PUSHMARK(SP);
939 0 0 XPUSHs(secretsv);
940 0 0 for (i=0; i
944 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)ciphers)));
945 0 0 XPUSHs(sv_2mortal(newRV_inc(pref_cipher)));
946 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
954 0 0 if (count != 1)
957 0 0 res = POPi;
958 0 0 if (res) {
960 0 0 if (SvIOK(pref_cipher))
961 0 0 *cipher = sk_SSL_CIPHER_value(peer_ciphers, SvIV(pref_cipher));
974 0 0 FREETMPS;
1002 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1008 0 0 PUSHMARK(SP);
1009 0 0 if (hint != NULL) {
1011 0 0 XPUSHs(hintsv);
1020 0 0 if (count != 2)
1023 0 0 psk_val = POPpx;
1024 0 0 identity_val = POPpx;
1026 0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
1028 0 0 if (BN_hex2bn(&psk_bn, psk_val) > 0) {
1029 0 0 if (BN_num_bytes(psk_bn) <= max_psk_len) {
1036 0 0 FREETMPS;
1062 0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1068 0 0 PUSHMARK(SP);
1069 0 0 if (hint != NULL) {
1071 0 0 XPUSHs(hintsv);
1080 0 0 if (count != 2)
1083 0 0 psk_val = POPpx;
1084 0 0 identity_val = POPpx;
1086 0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
0 0 my_snprintf(identity, max_identity_len, "%s", identity_val);
1088 0 0 if (BN_hex2bn(&psk_bn, psk_val) > 0) {
1089 0 0 if (BN_num_bytes(psk_bn) <= max_psk_len) {
1096 0 0 FREETMPS;
1110 0 8 if (last_index<0) return 0;
1111 16 8 for(i=0; i<=last_index; i++) {
1112 16 0 char *p = SvPV_nolen(*av_fetch(list, i, 0));
1114 0 16 if (len>255) return 0;
1115 8 8 if (out) {
1129 0 0 if (!list || inlen<2) return 0;
0 0 if (!list || inlen<2) return 0;
1130 0 0 while (i
1132 0 0 if (i+il > inlen) return 0;
1161 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1167 0 0 if (!next_proto_helper_protodata2AV(list, in, inlen)) return SSL_TLSEXT_ERR_ALERT_FATAL;
1171 0 0 PUSHMARK(SP);
1172 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1173 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)list)));
1174 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1178 0 0 if (count != 2)
1180 0 0 next_proto_data = (unsigned char*)POPpx;
1181 0 0 next_proto_status = POPi;
1184 0 0 if (next_proto_len<=255) {
1194 0 0 FREETMPS;
1197 0 0 return next_proto_len>255 ? SSL_TLSEXT_ERR_ALERT_FATAL : SSL_TLSEXT_ERR_OK;
1199 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)) {
1202 0 1 if (!next_proto_data) return SSL_TLSEXT_ERR_ALERT_FATAL;
1207 0 1 if (next_proto_status != OPENSSL_NPN_NEGOTIATED) {
1233 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1238 0 0 PUSHMARK(SP);
1239 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1240 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1244 0 0 if (count != 1)
1247 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)) {
1251 0 0 if (protodata) next_proto_helper_AV2protodata(tmpav, protodata);
1254 0 0 FREETMPS;
1257 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)) {
1261 1 0 if (protodata) next_proto_helper_AV2protodata(tmpav, protodata);
1263 1 0 if (protodata) {
1290 0 1 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
0 0 if (SvROK(cb_func) && (SvTYPE(SvRV(cb_func)) == SVt_PVCV)) {
1297 0 0 if (!next_proto_helper_protodata2AV(list, in, inlen)) return SSL_TLSEXT_ERR_ALERT_FATAL;
1301 0 0 PUSHMARK(SP);
1302 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1303 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)list)));
1304 0 0 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1308 0 0 if (count != 1)
1311 0 0 if (SvOK(alpn_data_sv)) {
0 0 if (SvOK(alpn_data_sv)) {
0 0 if (SvOK(alpn_data_sv)) {
1312 0 0 alpn_data = (unsigned char*)SvPV_nolen(alpn_data_sv);
1314 0 0 if (alpn_len <= 255) {
1324 0 0 FREETMPS;
1327 0 0 if (alpn_len>255) return SSL_TLSEXT_ERR_ALERT_FATAL;
1328 0 0 return alpn_data ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_NOACK;
1330 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)) {
1335 0 1 if (!alpn_data) return SSL_TLSEXT_ERR_ALERT_FATAL;
1341 0 1 if (status != OPENSSL_NPN_NEGOTIATED) {
1345 1 0 return status == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_NOACK;
1362 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)) {
1366 0 2 PUSHMARK(sp);
1368 0 2 XPUSHs(sv_2mortal( newSViv(bufsize-1) ));
1369 0 2 XPUSHs(sv_2mortal( newSViv(rwflag) ));
1370 0 2 if (cb->data) XPUSHs( cb->data );
0 0 if (cb->data) XPUSHs( cb->data );
1379 0 2 if (count != 1) {
1383 2 0 str = POPpx;
1385 2 0 if (str_len+1 < bufsize) {
1395 2 0 FREETMPS;
1408 608 0 if (cb->func && SvOK(cb->func)) {
453 155 if (cb->func && SvOK(cb->func)) {
453 0 if (cb->func && SvOK(cb->func)) {
0 453 if (cb->func && SvOK(cb->func)) {
1412 0 155 PUSHMARK(sp);
1414 0 155 XPUSHs(sv_2mortal( newSViv(i) ));
1415 0 155 XPUSHs(sv_2mortal( newSViv(n) ));
1416 16 139 if (cb->data) XPUSHs( cb->data );
0 16 if (cb->data) XPUSHs( cb->data );
1422 0 154 if (count != 0)
1427 154 0 FREETMPS;
1440 16 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 16 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1446 0 16 PUSHMARK(SP);
1447 0 16 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1448 0 16 XPUSHs(sv_2mortal(newSViv(where)) );
1449 0 16 XPUSHs(sv_2mortal(newSViv(ret)) );
1450 0 16 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1457 16 0 FREETMPS;
1470 457 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 457 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1476 0 457 PUSHMARK(SP);
1477 0 457 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1478 0 457 XPUSHs(sv_2mortal(newSViv(where)) );
1479 0 457 XPUSHs(sv_2mortal(newSViv(ret)) );
1480 0 457 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1487 457 0 FREETMPS;
1499 24 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 24 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1505 0 24 PUSHMARK(SP);
1506 0 24 XPUSHs(sv_2mortal(newSViv(write_p)));
1507 0 24 XPUSHs(sv_2mortal(newSViv(version)));
1508 0 24 XPUSHs(sv_2mortal(newSViv(content_type)));
1509 0 24 XPUSHs(sv_2mortal(newSVpv((const char*)buf, len)));
1510 0 24 XPUSHs(sv_2mortal(newSViv(len)));
1511 0 24 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1512 0 24 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1519 24 0 FREETMPS;
1532 24 0 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 24 if ( ! SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1538 0 24 PUSHMARK(SP);
1539 0 24 XPUSHs(sv_2mortal(newSViv(write_p)));
1540 0 24 XPUSHs(sv_2mortal(newSViv(version)));
1541 0 24 XPUSHs(sv_2mortal(newSViv(content_type)));
1542 0 24 XPUSHs(sv_2mortal(newSVpv((const char*)buf, len)));
1543 0 24 XPUSHs(sv_2mortal(newSViv(len)));
1544 0 24 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1545 0 24 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1552 24 0 FREETMPS;
1585 7 0 if (!SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
0 7 if (!SvROK(cb_func) || (SvTYPE(SvRV(cb_func)) != SVt_PVCV))
1590 0 7 PUSHMARK(SP);
1592 0 7 XPUSHs(sv_2mortal(newSVsv(cb_data)));
1594 4 3 if (!enc) {
1596 0 4 XPUSHs(sv_2mortal(newSVpv((const char *)key_name,16)));
1607 0 7 if (count>2)
1611 6 1 if (count>0) {
1613 0 6 if (SvOK(sname)) {
0 0 if (SvOK(sname)) {
0 0 if (SvOK(sname)) {
1614 6 0 unsigned char *pname = (unsigned char *)SvPV(sname,svlen);
1615 0 6 if (svlen > 16)
1617 0 6 if (svlen == 0)
1624 6 1 if (count>1) {
1626 0 6 if (SvOK(skey)) {
0 0 if (SvOK(skey)) {
0 0 if (SvOK(skey)) {
1627 6 0 unsigned char *pkey = (unsigned char *)SvPV(skey,svlen);
1628 0 6 if (svlen != 32 && svlen != 48)
0 0 if (svlen != 32 && svlen != 48)
1637 7 0 FREETMPS;
1640 4 3 if (!enc && usable_rv_count == 0) {
1 3 if (!enc && usable_rv_count == 0) {
1644 0 6 if (usable_rv_count != 2)
1647 3 3 if (enc) {
1659 2 1 if (memcmp(name,key_name,16) == 0)
1679 0 6 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1685 0 6 PUSHMARK(sp);
1686 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(ssl))));
1687 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(sess))));
1694 0 6 if (count != 1)
1697 6 0 remove = POPi;
1700 6 0 FREETMPS;
1714 0 6 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
0 0 if(!SvOK(cb_func))
1720 0 6 PUSHMARK(sp);
1721 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(ctx))));
1722 0 6 XPUSHs(sv_2mortal(newSViv(PTR2IV(sess))));
1730 6 0 FREETMPS;
1812 0 0 if (asn1t->type == V_ASN1_UTCTIME) {
1813 0 0 if (asn1t->length<12 || asn1t->length>17) return 0;
0 0 if (asn1t->length<12 || asn1t->length>17) return 0;
1814 0 0 if (asn1t->length>12) tz = 12;
1816 0 0 if (asn1t->length<14) return 0;
1817 0 0 if (asn1t->length>14) {
1818 0 0 if (p[14] == '.') {
1820 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++) ;
1821 0 0 if (ilength) tz = i;
1828 0 0 l = msec ? msec : tz ? tz : asn1t->length;
0 0 l = msec ? msec : tz ? tz : asn1t->length;
1829 0 0 for(i=0;i
1830 0 0 if (p[i]<'0' || p[i]>'9') return 0;
0 0 if (p[i]<'0' || p[i]>'9') return 0;
1835 0 0 if (asn1t->type == V_ASN1_UTCTIME) { /* YY - two digit year */
1837 0 0 if (t.tm_year < 70) t.tm_year += 100;
1852 0 0 if (tz) {
1854 0 0 if (p[tz] == 'Z') {
1855 0 0 if (asn1t->length>tz+1 ) return 0;
1856 0 0 } else if (asn1t->length
0 0 } else if (asn1t->length
0 0 } else if (asn1t->length
1859 0 0 if (asn1t->length>tz+5 ) return 0;
1860 0 0 for(i=tz+1;i
1861 0 0 if (p[i]<'0' || p[i]>'9') return 0;
0 0 if (p[i]<'0' || p[i]>'9') return 0;
1865 0 0 if (p[tz]=='+') adj*= -1; /* +0500: subtract 5 hours to get UTC */
1870 0 0 if (result == -1) return 0; /* broken time */
1872 0 0 if (gmtoff && *gmtoff == -1) {
0 0 if (gmtoff && *gmtoff == -1) {
1886 0 0 if (chain) {
1887 0 0 for(i=0;i
1888 0 0 if ( X509_check_issued(sk_X509_value(chain,i),cert) == X509_V_OK ) {
1895 0 0 if ( !issuer && store ) {
0 0 if ( !issuer && store ) {
1897 0 0 if (stx && X509_STORE_CTX_init(stx,store,cert,NULL)) {
0 0 if (stx && X509_STORE_CTX_init(stx,store,cert,NULL)) {
1899 0 0 if (ok<0) {
1901 0 0 if(err) {
1906 0 0 } else if (ok == 0 ) {
1912 0 0 if (stx) X509_STORE_CTX_free(stx);
1921 8 0 : &PL_sv_undef;
2154 7 0 RETVAL = SSL_CTX_load_verify_locations (ctx,
7 0 RETVAL = SSL_CTX_load_verify_locations (ctx,
2155 7 0 CAfile?(*CAfile?CAfile:NULL):NULL,
2156 0 7 CApath?(*CApath?CApath:NULL):NULL
2175 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)) {
2222 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)) {
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)) {
2347 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))
2354 306 0 if (GIMME_V==G_ARRAY) {
286 20 if (GIMME_V==G_ARRAY) {
2355 0 286 EXTEND(SP, 2);
2356 281 5 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2361 0 20 EXTEND(SP, 1);
2362 19 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2379 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))
2386 5 0 if (GIMME_V==G_ARRAY) {
2 3 if (GIMME_V==G_ARRAY) {
2387 0 2 EXTEND(SP, 2);
2388 1 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2393 0 3 EXTEND(SP, 1);
2394 2 1 PUSHs(sv_2mortal(succeeded ? newSVpvn(buf, got) : newSV(0)));
2503 0 22 if (len < 0) {
2656 2 2 if( sk == NULL ) {
2659 194 2 for (i=0; i
2661 0 194 XPUSHs(sv_2mortal(newSViv(PTR2IV(c))));
2687 7 0 if(SSL_get_shared_ciphers(s, buf, sizeof(buf)))
2703 0 0 if( chain == NULL ) {
2706 0 0 for (i=0; i
2708 0 0 XPUSHs(sv_2mortal(newSViv(PTR2IV(x))));
2717 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)) {
2780 0 3 if (!(len = i2d_SSL_SESSION(sess,NULL))) croak("invalid SSL_SESSION");
2782 0 3 if (!pc) croak("out of memory");
2785 0 3 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
2794 7 0 if (SvPOK(pv)) {
2797 7 0 p = (unsigned char*)SvPV(pv,len);
3069 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)) {
3219 43 1 if (!LIB_initialized) {
3317 0 0 RAND_add((const void *)SvPV(buf, len), num, entropy);
3332 0 3 if (!RAND_file_name(buf, num)) {
3371 0 0 RETVAL = X509_check_host(cert, name, 0, flags, (items == 4) ? &c_peername : NULL);
3372 0 0 if (items == 4)
3377 0 0 if (c_peername)
3393 0 0 c_address = (unsigned char *)SvPV(address, addresslen);
3500 17 0 if ((buf = X509_NAME_oneline(name, NULL, 0))) {
3517 13 0 if (bp) {
3518 13 0 if (X509_NAME_print_ex(bp, name, ident, flags)) {
3521 13 0 if (buf) {
3523 13 0 if (i>=0 && i<=n) {
13 0 if (i>=0 && i<=n) {
3525 0 13 if (utf8_decode) sv_utf8_decode(ST(0));
3544 1 0 if (length>=0) {
3546 1 0 if (X509_NAME_get_text_by_NID(name, nid, buf, length + 1)>=0)
3672 1 0 if (crl && crl_number)
1 0 if (crl && crl_number)
3673 1 0 if (X509_CRL_add1_ext_i2d(crl, NID_crl_number, crl_number, 0, 0)) RETVAL = 1;
3684 1 0 if (!RETVAL || i==-1) XSRETURN_UNDEF;
0 1 if (!RETVAL || i==-1) XSRETURN_UNDEF;
3704 2 0 if (rev) {
3705 2 0 if (BN_hex2bn(&bn, serial_hex)) {
3707 2 0 if (sn) {
3715 0 2 if (!rv) XSRETURN_IV(0);
3717 0 2 if (!rev_time) XSRETURN_IV(0);
3718 0 2 if (!X509_REVOKED_set_revocationDate(rev, rev_time)) XSRETURN_IV(0);
3720 2 0 if(reason_code) {
3723 2 0 if (rsn) {
3724 2 0 if (ASN1_ENUMERATED_set(rsn, reason_code))
3725 2 0 if (X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rsn, 0, 0))
3729 0 2 if (!rv) XSRETURN_IV(0);
3732 2 0 if(comp_time) {
3736 0 2 if(!X509_CRL_add0_revoked(crl, rev)) XSRETURN_IV(0);
3809 1 1 for (i=0; i
3812 0 1 XPUSHs(sv_2mortal(newSViv(PTR2IV(s))));
3827 1 0 if (items>1) {
3830 6 1 while(i+1
3831 6 0 nid = SvIV(ST(i));
3832 6 0 data = SvPV_nolen(ST(i+1));
3835 6 0 if (ex)
3859 1 0 if (items>1) {
3861 6 1 while(i+1
3862 6 0 nid = SvIV(ST(i));
3863 6 0 data = SvPV_nolen(ST(i+1));
3867 6 0 if (ex) {
3894 1 0 if (items>1) {
3896 1 1 while(i+1
3897 1 0 nid = SvIV(ST(i));
3898 1 0 data = SvPV_nolen(ST(i+1));
3902 1 0 if (ex) {
3929 1 0 if (!x509 || !x509_req) XSRETURN_IV(0);
0 1 if (!x509 || !x509_req) XSRETURN_IV(0);
3931 6 1 for(i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
3936 0 6 if (idx != -1) {
3937 0 0 if (override) continue; /* don't override existing extension */
3944 0 0 } while (idx != -1);
3946 0 6 if (!X509_add_ext(x509, ext, -1)) ret = 0;
4000 9 0 if (!k && !strcmp(type,"md5")) {
4 5 if (!k && !strcmp(type,"md5")) {
4004 5 4 if (!k && !strcmp(type,"sha1")) {
4 1 if (!k && !strcmp(type,"sha1")) {
4009 1 8 if (!k && !strcmp(type,"sha256")) {
0 1 if (!k && !strcmp(type,"sha256")) {
4014 1 8 if (!k && !strcmp(type,"ripemd160")) {
0 1 if (!k && !strcmp(type,"ripemd160")) {
4017 1 8 if (!k) /* Default digest */
4019 0 9 if ( digest_tp == NULL ) {
4023 0 9 if (!X509_digest(cert, digest_tp, digest, &dsz)) {
4028 164 9 for(k=0; k
4044 3 2 if ( (i = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1)) >= 0
4045 3 0 && (subjAltNameExt = X509_get_ext(cert, i))
4046 3 0 && (subjAltNameDNs = X509V3_EXT_d2i(subjAltNameExt)))
4050 16 3 for (j = 0; j < num_gnames; j++)
4057 0 2 EXTEND(SP, 2);
4066 0 8 EXTEND(SP, 2);
4075 0 0 EXTEND(SP, 2);
4086 2 0 if (len < 0 || len > (int)((sizeof(buf) - 1)))
2 0 if (len < 0 || len > (int)((sizeof(buf) - 1)))
4088 0 2 EXTEND(SP, 2);
4096 0 4 EXTEND(SP, 2);
4121 1 3 if (points)
4122 2 1 for (i = 0; i < sk_DIST_POINT_num(points); i++) {
4124 0 2 if (!p->distpoint)
4126 2 0 if (p->distpoint->type == 0) {
4129 2 2 for (j = 0; j < sk_GENERAL_NAME_num(gnames); j++) {
4132 2 0 if (gn->type == GEN_URI) {
4133 0 2 XPUSHs(sv_2mortal(newSVpv((char*)ASN1_STRING_data(gn->d.ia5),ASN1_STRING_length(gn->d.ia5))));
4168 0 0 if (!info) XSRETURN_UNDEF;
4170 0 0 for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
4172 0 0 if (OBJ_obj2nid(ad->method) == NID_ad_OCSP
4173 0 0 && ad->location->type == GEN_URI) {
4174 0 0 XPUSHs(sv_2mortal(newSVpv(
4178 0 0 if (GIMME == G_SCALAR) break; /* get only first */
0 0 if (GIMME == G_SCALAR) break; /* get only first */
4194 76 16 for(i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
4198 19 57 if(format==0)
4199 0 19 XPUSHs(sv_2mortal(newSVpv(buffer,0))); /* format 0: oid */
4200 19 38 else if(format==1 && nid>0)
16 3 else if(format==1 && nid>0)
4201 0 16 XPUSHs(sv_2mortal(newSViv(nid))); /* format 1: nid */
4202 19 22 else if(format==2 && nid>0)
16 3 else if(format==2 && nid>0)
4203 0 16 XPUSHs(sv_2mortal(newSVpv(OBJ_nid2sn(nid),0))); /* format 2: shortname */
4204 19 6 else if(format==3 && nid>0)
16 3 else if(format==3 && nid>0)
4205 0 16 XPUSHs(sv_2mortal(newSVpv(OBJ_nid2ln(nid),0))); /* format 3: longname */
4217 4 0 if (u) {
4218 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)));
4219 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)));
4220 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)));
4221 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)));
4222 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)));
4223 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)));
4224 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)));
4225 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)));
4226 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)));
4236 0 4 if (u) {
4237 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)));
4238 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)));
4239 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)));
4240 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)));
4241 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)));
4242 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)));
4243 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)));
4244 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)));
4297 21 0 if (bp) {
4298 21 0 if(X509V3_EXT_print(bp,ext,flags,indent)) {
4301 21 0 if (buf) {
4303 21 0 if (i>=0 && i<=n) {
21 0 if (i>=0 && i<=n) {
4305 0 21 if (utf8_decode) sv_utf8_decode(ST(0));
4466 0 3 if (!BN_hex2bn(&bn, str)) XSRETURN_IV(0);
4467 0 3 if (!BN_to_ASN1_INTEGER(bn, i)) rv = 0;
4480 0 1 if (!BN_dec2bn(&bn, str)) XSRETURN_IV(0);
4481 0 1 if (!BN_to_ASN1_INTEGER(bn, i)) rv = 0;
4493 0 6 if (!bn) XSRETURN_UNDEF;
4497 0 6 if (!result) XSRETURN_UNDEF;
4498 0 6 XPUSHs(sv_2mortal(newSVpv((const char*)result, strlen(result))));
4509 0 5 if (!bn) XSRETURN_UNDEF;
4513 0 5 if (!result) XSRETURN_UNDEF;
4514 0 5 XPUSHs(sv_2mortal(newSVpv((const char*)result, strlen(result))));
4525 43 44 if (utf8_decode) sv_utf8_decode(u8);
4526 0 87 XPUSHs(sv_2mortal(u8));
4572 4 0 if (tm) {
4574 4 0 if (bp) {
4578 4 0 if (i>0)
4597 14 0 if (tmp) {
4598 14 0 if (ASN1_GENERALIZEDTIME_check(tmp)) {
4599 14 0 if (strlen((char*)tmp->data)>=14 && strlen((char*)tmp->data)<200) {
14 0 if (strlen((char*)tmp->data)>=14 && strlen((char*)tmp->data)<200) {
4607 14 0 if (strlen((char*)tmp->data)>14) strcat(buf+19,(char*)tmp->data+14);
4624 1 10 if (!tm) XSRETURN_UNDEF;
4626 0 10 if (strlen(str) < 19) XSRETURN_UNDEF;
4627 40 0 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 40 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
40 10 for (i=0; i<4; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4628 20 0 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 20 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
20 10 for (i=5; i<7; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4629 20 0 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 20 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
20 10 for (i=8; i<10; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4630 20 0 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 20 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
20 10 for (i=11; i<13; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4631 20 0 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 20 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
20 10 for (i=14; i<16; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4632 20 0 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
0 20 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
20 10 for (i=17; i<19; i++) if ((str[i] > '9') || (str[i] < '0')) XSRETURN_UNDEF;
4640 10 0 if (strlen(str)>19 && strlen(str)<200) strcat(buf,str+19);
10 0 if (strlen(str)>19 && strlen(str)<200) strcat(buf,str+19);
4648 10 0 if (!ASN1_TIME_check(&t)) {
4650 0 10 if (!ASN1_TIME_check(&t)) XSRETURN_UNDEF;
4654 0 10 if (!ASN1_STRING_set(tm,t.data,t.length)) XSRETURN_UNDEF;
4701 3 0 if (bp && x509) {
3 0 if (bp && x509) {
4705 3 0 if (buf) {
4707 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);
4723 1 0 if (bp && x509_req) {
1 0 if (bp && x509_req) {
4727 1 0 if (buf) {
4729 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);
4745 1 0 if (bp && x509_crl) {
1 0 if (bp && x509_crl) {
4749 1 0 if (buf) {
4751 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);
4772 6 0 if (bp && pk) {
6 0 if (bp && pk) {
4773 2 4 if (passwd) passwd_len = strlen(passwd);
4774 2 4 if (passwd_len>0) {
4776 1 1 if (!enc_alg)
4787 6 0 if (buf) {
4789 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);
4807 0 0 if ((fp = fopen (file, "rb"))) {
4813 0 0 if ((p12 = d2i_PKCS12_fp(fp, NULL))) {
4814 0 0 if (PKCS12_parse(p12, password, &private_key, &certificate, NULL)) {
4815 0 0 if (private_key) {
4816 0 0 if (SSL_CTX_use_PrivateKey(ctx, private_key)) RETVAL = 1;
4819 0 0 if (certificate) {
4820 0 0 if (SSL_CTX_use_certificate(ctx, certificate)) RETVAL = 1;
4826 0 0 if (!RETVAL) ERR_print_errors_fp(stderr);
4846 4 0 if ((fp = fopen (file, "rb"))) {
4852 4 0 if ((p12 = d2i_PKCS12_fp(fp, NULL))) {
4853 3 1 if(load_chain)
4857 4 0 if (result) {
4858 4 0 if (private_key)
4859 0 4 XPUSHs(sv_2mortal(newSViv(PTR2IV(private_key))));
4861 0 0 XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef */
4862 4 0 if (certificate)
4863 0 4 XPUSHs(sv_2mortal(newSViv(PTR2IV(certificate))));
4865 0 0 XPUSHs(sv_2mortal(newSVpv(NULL,0))); /* undef */
4866 1 3 if (cachain) {
4867 2 1 for (i=0; i
4869 0 2 XPUSHs(sv_2mortal(newSViv(PTR2IV(x))));
4909 9 0 if (MD4(data,len,md)) {
4927 9 0 if (MD5(data,len,md)) {
4945 9 0 if (RIPEMD160(data,len,md)) {
4963 8 0 if (SHA1(data,len,md)) {
4980 8 0 if (SHA256(data,len,md)) {
4997 8 0 if (SHA512(data,len,md)) {
5184 55 83 if ((got = BIO_read(s, buf, max)) >= 0)
5261 0 194 if(description == NULL) {
5264 0 194 XPUSHs(sv_2mortal(newSVpv(description, 0)));
5275 0 390 if (items > 2) croak("SSL_CIPHER_get_bits: Need to call with one or two parameters");
5276 194 196 if (items > 1) sv_setsv(ST(1), sv_2mortal(newSViv(alg_bits)));
5343 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)) {
5372 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)) {
5389 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)) {
5505 3 1 if (count > finished_len)
5524 3 1 if (count > finished_len)
5642 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)) {
5658 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)) {
5674 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)) {
5690 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)) {
6005 0 1 if (SvIOK(curve)) {
6006 0 0 nid = SvIV(curve);
6008 1 0 nid = OBJ_sn2nid(SvPV_nolen(curve));
6010 0 1 if (!nid) nid = EC_curve_nist2nid(SvPV_nolen(curve));
0 0 if (!nid) nid = EC_curve_nist2nid(SvPV_nolen(curve));
6012 0 1 if (!nid) croak("unknown curve %s",SvPV_nolen(curve));
0 0 if (!nid) croak("unknown curve %s",SvPV_nolen(curve));
6016 0 1 if (!group) croak("unknown curve nid=%d",nid);
6020 1 0 if ( eckey
6021 1 0 && EC_KEY_set_group(eckey, group)
6022 1 0 && EC_KEY_generate_key(eckey)) {
6025 0 0 if (eckey) EC_KEY_free(eckey);
6027 1 0 if (group) EC_GROUP_free(group);
6223 0 8 if(!e)
6229 0 8 if(!ret) {
6253 7 0 if (rc == -1 || ret == NULL) {
0 7 if (rc == -1 || ret == NULL) {
6254 0 0 if (ret) RSA_free(ret);
6289 0 1 XPUSHs(bn2sv(rsa->n));
6290 0 1 XPUSHs(bn2sv(rsa->e));
6291 0 1 XPUSHs(bn2sv(rsa->d));
6292 0 1 XPUSHs(bn2sv(rsa->p));
6293 0 1 XPUSHs(bn2sv(rsa->q));
6294 0 1 XPUSHs(bn2sv(rsa->dmp1));
6295 0 1 XPUSHs(bn2sv(rsa->dmq1));
6296 0 1 XPUSHs(bn2sv(rsa->iqmp));
6423 6 2 if (SvOK(perl_cb)) {
6 0 if (SvOK(perl_cb)) {
0 6 if (SvOK(perl_cb)) {
6429 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)) {
6433 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)) {
6574 1 0 if (s == NULL ||
1 0 if (s == NULL ||
6575 1 0 s->enc_read_ctx == NULL ||
6576 0 1 s->enc_read_ctx->cipher == NULL ||
6589 1 0 if (s->s3)
6602 1 0 : -1;
6635 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)) {
6655 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)) {
6669 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)) {
6688 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)) {
6782 57 0 if (EVP_DigestFinal(ctx,md,&md_size))
6794 9 0 if (EVP_DigestFinal_ex(ctx,md,&md_size))
6810 48 0 if (EVP_Digest(data,len,md,&md_size,type,impl))
7132 4 0 if (X509_pubkey_digest(data,type,md,&md_size))
7147 4 0 if (X509_digest(data,type,md,&md_size))
7159 1 0 if (X509_CRL_digest(data,type,md,&md_size))
7171 1 0 if (X509_REQ_digest(data,type,md,&md_size))
7183 0 0 if (X509_NAME_digest(data,type,md,&md_size))
7232 0 1 if (!(pkey = X509_get_X509_PUBKEY(x))) croak("invalid certificate");
7233 0 1 if (!(len = i2d_X509_PUBKEY(pkey, NULL))) croak("invalid certificate public key");
7235 0 1 if (!pc) croak("out of memory");
7238 0 1 if (pi-pc != len) croak("invalid encoded length");
7239 0 1 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7251 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)) {
7257 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7264 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7283 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)) {
7289 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7296 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7316 0 2 XPUSHs(sv_2mortal(newSVpv((char *)data, len)));
7322 0 1 XPUSHs(sv_2mortal(newSVsv(cb_data_advanced_get((void*)s, "next_proto_select_cb!!last_status"))));
7356 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)) {
7360 0 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7377 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)) {
7381 1 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
1 0 } else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7401 1 0 if (ticketlen > 0) {
7403 0 1 if (!p)
7419 0 0 if (SvPOK(pv)) {
7422 0 0 p = (unsigned char*)SvPV(pv,len);
7434 0 0 if (!(len = i2d_OCSP_RESPONSE(r,NULL))) croak("invalid OCSP response");
7436 0 0 if (!pc) croak("out of memory");
7439 0 0 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7452 0 0 if (SvPOK(pv)) {
7455 0 0 p = (unsigned char*)SvPV(pv,len);
7467 0 0 if (!(len = i2d_OCSP_REQUEST(r,NULL))) croak("invalid OCSP request");
7469 0 0 if (!pc) croak("out of memory");
7472 0 0 XPUSHs(sv_2mortal(newSVpv((char*)pc,len)));
7500 0 0 if (!ssl) croak("not a SSL object");
7502 0 0 if (!ctx) croak("invalid SSL object - no context");
7506 0 0 for(i=0;i
7507 0 0 cert = INT2PTR(X509*,SvIV(ST(i+1)));
7508 0 0 if (X509_check_issued(cert,cert) == X509_V_OK)
7510 0 0 if (!(issuer = find_issuer(cert,store,chain)))
7514 0 0 if (!id)
7518 0 0 if (!(len = i2d_OCSP_CERTID(id,&pi)))
7520 0 0 XPUSHs(sv_2mortal(newSVpvn((char *)pi, len)));
7535 0 0 if (!req) croak("out of memory");
7538 0 0 for(i=0;i
7540 0 0 const unsigned char *p = (unsigned char*)SvPV(ST(i),len);
7542 0 0 if (!id) {
7567 0 0 if (!ssl) croak("not a SSL object");
7569 0 0 if (!ctx) croak("invalid SSL object - no context");
7572 0 0 if (!bsr) croak("invalid OCSP response");
7576 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) &&
7577 0 0 (req = INT2PTR(OCSP_REQUEST*,SvIV(svreq)))) {
7579 0 0 if ( i <= 0 ) {
7580 0 0 if (i == -1) {
7590 0 0 if ((store = SSL_CTX_get_cert_store(ctx))) {
7595 0 0 for(i=0;i
7600 0 0 if (chain && !RETVAL) {
0 0 if (chain && !RETVAL) {
7608 0 0 if (last && (issuer = find_issuer(last,store,chain))) {
0 0 if (last && (issuer = find_issuer(last,store,chain))) {
7632 0 0 if (!bsr) croak("invalid OCSP response");
7634 0 0 want_array = (GIMME == G_ARRAY);
7638 0 0 for(i=0; i < (getall ? sksn : items-1); i++) {
0 0 for(i=0; i < (getall ? sksn : items-1); i++) {
7646 0 0 if(getall) {
7653 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");
7654 0 0 p = (unsigned char*)SvPV(idsv,len);
7655 0 0 if (!(certid = d2i_OCSP_CERTID(NULL,&p,len))) {
7660 0 0 if (first >= 0)
7664 0 0 if (sir)
7670 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED)
7675 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED) {
7677 0 0 } else if (status != V_OCSP_CERTSTATUS_GOOD) {
7680 0 0 else if (!OCSP_check_validity(thisupdate, nextupdate, 0, -1)) {
7688 0 0 if (want_array) {
7690 0 0 if (!idsv) {
7698 0 0 if(!len) continue;
7700 0 0 if (!pc) croak("out of memory");
7714 0 0 av_push(idav, error ? newSVpv(error,0) : newSV(0));
7715 0 0 if (sir) {
7720 0 0 if (nextupdate) hv_store(details,"nextUpdate",10,
7722 0 0 if (thisupdate) hv_store(details,"thisUpdate",10,
7724 0 0 if (status == V_OCSP_CERTSTATUS_REVOKED) {
7735 0 0 XPUSHs(sv_2mortal(newRV_noinc((SV*)idav)));
7736 0 0 } else if (!error) {
7739 0 0 if (!nextupd || nextupd>nu) nextupd = nu;
0 0 if (!nextupd || nextupd>nu) nextupd = nu;
7742 0 0 if (certid) OCSP_CERTID_free(certid);
7743 0 0 if (error && !want_array) {
0 0 if (error && !want_array) {
7749 0 0 if (!want_array)
7750 0 0 XPUSHs(sv_2mortal(newSViv(nextupd)));
7765 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)) {
7771 1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
1 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVAV)) {
7778 0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
0 0 else if (SvROK(callback) && (SvTYPE(SvRV(callback)) == SVt_PVCV)) {
7801 1 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
0 1 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
7805 0 1 if (!alpn_data)
7825 0 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
0 0 if (!SvROK(data) || (SvTYPE(SvRV(data)) != SVt_PVAV))
7829 0 0 if (!alpn_data)
7846 0 2 XPUSHs(sv_2mortal(newSVpv((char *)data, len)));
7869 9 6 if (context != &PL_sv_undef) {
7871 9 0 context_arg = SvPV( ST(3), contextlen);
7874 15 0 PUSHs(sv_2mortal(ret>0 ? newSVpvn((const char *)out, outlen) : newSV(0)));
7875 0 15 EXTEND(SP, 1);