diff -up kdelibs-3.5.10/kio/kssl/kopenssl.cc.ossl-1.x kdelibs-3.5.10/kio/kssl/kopenssl.cc
old
|
new
|
static int (*K_BIO_write) (BIO *b, cons |
96 | 96 | static int (*K_PEM_ASN1_write_bio) (int (*)(),const char *,BIO *,char *, |
97 | 97 | const EVP_CIPHER *,unsigned char *,int , |
98 | 98 | pem_password_cb *, void *) = 0L; |
| 99 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 100 | static int (*K_ASN1_item_i2d_fp)(ASN1_ITEM *,FILE *,unsigned char *) = 0L; |
| 101 | static ASN1_ITEM *K_NETSCAPE_X509_it = 0L; |
| 102 | #else |
99 | 103 | static ASN1_METHOD* (*K_X509_asn1_meth) (void) = 0L; |
100 | 104 | static int (*K_ASN1_i2d_fp)(int (*)(),FILE *,unsigned char *) = 0L; |
101 | 105 | static int (*K_i2d_ASN1_HEADER)(ASN1_HEADER *, unsigned char **) = 0L; |
| 106 | #endif |
102 | 107 | static int (*K_X509_print_fp) (FILE *, X509*) = 0L; |
103 | 108 | static int (*K_i2d_PKCS12) (PKCS12*, unsigned char**) = 0L; |
104 | 109 | static int (*K_i2d_PKCS12_fp) (FILE *, PKCS12*) = 0L; |
… |
… |
KConfig *cfg; |
430 | 435 | K_BIO_ctrl = (long (*) (BIO *,int,long,void *)) _cryptoLib->symbol("BIO_ctrl"); |
431 | 436 | K_BIO_write = (int (*) (BIO *b, const void *data, int len)) _cryptoLib->symbol("BIO_write"); |
432 | 437 | K_PEM_ASN1_write_bio = (int (*)(int (*)(), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) _cryptoLib->symbol("PEM_ASN1_write_bio"); |
| 438 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 439 | K_ASN1_item_i2d_fp = (int (*)(ASN1_ITEM *, FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_item_i2d_fp"); |
| 440 | K_NETSCAPE_X509_it = (ASN1_ITEM *) _cryptoLib->symbol("NETSCAPE_X509_it"); |
| 441 | #else |
433 | 442 | K_X509_asn1_meth = (ASN1_METHOD* (*)(void)) _cryptoLib->symbol("X509_asn1_meth"); |
434 | 443 | K_ASN1_i2d_fp = (int (*)(int (*)(), FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_i2d_fp"); |
435 | 444 | K_i2d_ASN1_HEADER = (int (*)(ASN1_HEADER *, unsigned char **)) _cryptoLib->symbol("i2d_ASN1_HEADER"); |
| 445 | #endif |
436 | 446 | K_X509_print_fp = (int (*)(FILE*, X509*)) _cryptoLib->symbol("X509_print_fp"); |
437 | 447 | K_i2d_PKCS12 = (int (*)(PKCS12*, unsigned char**)) _cryptoLib->symbol("i2d_PKCS12"); |
438 | 448 | K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) _cryptoLib->symbol("i2d_PKCS12_fp"); |
… |
… |
KConfig *cfg; |
594 | 604 | K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) _sslLib->symbol("SSL_set_session"); |
595 | 605 | K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,unsigned char**, long)) _sslLib->symbol("d2i_SSL_SESSION"); |
596 | 606 | K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,unsigned char**)) _sslLib->symbol("i2d_SSL_SESSION"); |
597 | | K_SSL_get_ciphers = (STACK *(*)(const SSL*)) _sslLib->symbol("SSL_get_ciphers"); |
| 607 | K_SSL_get_ciphers = (STACK_OF(SSL_CIPHER) *(*)(const SSL*)) _sslLib->symbol("SSL_get_ciphers"); |
598 | 608 | #endif |
599 | 609 | |
600 | 610 | |
… |
… |
int KOpenSSLProxy::PEM_write_bio_X509(BI |
982 | 992 | else return -1; |
983 | 993 | } |
984 | 994 | |
985 | | |
| 995 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 996 | int KOpenSSLProxy::ASN1_i2d_fp(FILE *out,unsigned char *x) { |
| 997 | if (K_ASN1_item_i2d_fp && K_NETSCAPE_X509_it) |
| 998 | return (K_ASN1_item_i2d_fp)(K_NETSCAPE_X509_it, out, x); |
| 999 | else return -1; |
| 1000 | } |
| 1001 | #else |
986 | 1002 | ASN1_METHOD *KOpenSSLProxy::X509_asn1_meth(void) { |
987 | 1003 | if (K_X509_asn1_meth) return (K_X509_asn1_meth)(); |
988 | 1004 | else return 0L; |
… |
… |
int KOpenSSLProxy::ASN1_i2d_fp(FILE *out |
994 | 1010 | return (K_ASN1_i2d_fp)((int (*)())K_i2d_ASN1_HEADER, out, x); |
995 | 1011 | else return -1; |
996 | 1012 | } |
997 | | |
| 1013 | #endif |
998 | 1014 | |
999 | 1015 | int KOpenSSLProxy::X509_print(FILE *fp, X509 *x) { |
1000 | 1016 | if (K_X509_print_fp) return (K_X509_print_fp)(fp, x); |
diff -up kdelibs-3.5.10/kio/kssl/kopenssl.h.ossl-1.x kdelibs-3.5.10/kio/kssl/kopenssl.h
old
|
new
|
class KOpenSSLProxyPrivate; |
48 | 48 | #include <openssl/stack.h> |
49 | 49 | #include <openssl/bn.h> |
50 | 50 | #undef crypt |
| 51 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 52 | #define STACK _STACK |
| 53 | #endif |
51 | 54 | #endif |
52 | 55 | |
53 | 56 | #include <kstaticdeleter.h> |
… |
… |
public: |
446 | 449 | */ |
447 | 450 | int PEM_write_bio_X509(BIO *bp, X509 *x); |
448 | 451 | |
449 | | |
| 452 | #if OPENSSL_VERSION_NUMBER < 0x10000000L |
450 | 453 | /* |
451 | 454 | * X509_asn1_meth - used for netscape output |
452 | 455 | */ |
453 | 456 | ASN1_METHOD *X509_asn1_meth(); |
454 | | |
| 457 | #endif |
455 | 458 | |
456 | 459 | /* |
457 | 460 | * ASN1_i2d_fp - used for netscape output |
… |
… |
public: |
531 | 534 | */ |
532 | 535 | void sk_free(STACK *s); |
533 | 536 | |
| 537 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 538 | void sk_free(void *s) { return sk_free(reinterpret_cast<STACK*>(s)); } |
| 539 | #endif |
534 | 540 | |
535 | 541 | /* |
536 | 542 | * Number of elements in the stack |
… |
… |
public: |
543 | 549 | */ |
544 | 550 | char *sk_value(STACK *s, int n); |
545 | 551 | |
| 552 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 553 | char *sk_value(void *s, int n) { return sk_value(reinterpret_cast<STACK*>(s), n); } |
| 554 | #endif |
546 | 555 | |
547 | 556 | /* |
548 | 557 | * Create a new stack |
… |
… |
public: |
555 | 564 | */ |
556 | 565 | int sk_push(STACK *s, char *d); |
557 | 566 | |
| 567 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 568 | int sk_push(void *s, void *d) { return sk_push(reinterpret_cast<STACK*>(s), reinterpret_cast<char*>(d)); } |
| 569 | #endif |
558 | 570 | |
559 | 571 | /* |
560 | 572 | * Duplicate the stack |
diff -up kdelibs-3.5.10/kio/kssl/ksmimecrypto.cc.ossl-1.x kdelibs-3.5.10/kio/kssl/ksmimecrypto.cc
old
|
new
|
KSMIMECryptoPrivate::KSMIMECryptoPrivate |
87 | 87 | |
88 | 88 | |
89 | 89 | STACK_OF(X509) *KSMIMECryptoPrivate::certsToX509(QPtrList<KSSLCertificate> &certs) { |
90 | | STACK_OF(X509) *x509 = sk_new(NULL); |
| 90 | STACK_OF(X509) *x509 = reinterpret_cast<STACK_OF(X509)*>(sk_new(NULL)); |
91 | 91 | KSSLCertificate *cert = certs.first(); |
92 | 92 | while(cert) { |
93 | 93 | sk_X509_push(x509, cert->getCert()); |
diff -up kdelibs-3.5.10/kio/kssl/ksslcertificate.cc.ossl-1.x kdelibs-3.5.10/kio/kssl/ksslcertificate.cc
old
|
new
|
return qba; |
1003 | 1003 | QByteArray KSSLCertificate::toNetscape() { |
1004 | 1004 | QByteArray qba; |
1005 | 1005 | #ifdef KSSL_HAVE_SSL |
1006 | | ASN1_HEADER ah; |
1007 | | ASN1_OCTET_STRING os; |
1008 | | KTempFile ktf; |
| 1006 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 1007 | NETSCAPE_X509 nx; |
| 1008 | ASN1_OCTET_STRING hdr; |
| 1009 | #else |
| 1010 | ASN1_HEADER ah; |
| 1011 | ASN1_OCTET_STRING os; |
| 1012 | #endif |
| 1013 | KTempFile ktf; |
1009 | 1014 | |
1010 | | os.data = (unsigned char *)NETSCAPE_CERT_HDR; |
1011 | | os.length = strlen(NETSCAPE_CERT_HDR); |
1012 | | ah.header = &os; |
1013 | | ah.data = (char *)getCert(); |
1014 | | ah.meth = d->kossl->X509_asn1_meth(); |
| 1015 | #if OPENSSL_VERSION_NUMBER >= 0x10000000L |
| 1016 | hdr.data = (unsigned char *)NETSCAPE_CERT_HDR; |
| 1017 | hdr.length = strlen(NETSCAPE_CERT_HDR); |
| 1018 | nx.header = &hdr; |
| 1019 | nx.cert = getCert(); |
| 1020 | |
| 1021 | d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&nx); |
| 1022 | #else |
| 1023 | os.data = (unsigned char *)NETSCAPE_CERT_HDR; |
| 1024 | os.length = strlen(NETSCAPE_CERT_HDR); |
| 1025 | ah.header = &os; |
| 1026 | ah.data = (char *)getCert(); |
| 1027 | ah.meth = d->kossl->X509_asn1_meth(); |
1015 | 1028 | |
1016 | | d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&ah); |
| 1029 | d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&ah); |
| 1030 | #endif |
1017 | 1031 | |
1018 | 1032 | ktf.close(); |
1019 | 1033 | |