Index: kopenssl.cc =================================================================== RCS file: /home/kde/kdelibs/kssl/Attic/kopenssl.cc,v retrieving revision 1.24.2.1 diff -u -p -r1.24.2.1 kopenssl.cc --- kopenssl.cc 2001/08/21 16:07:31 1.24.2.1 +++ kopenssl.cc 2002/08/12 20:53:43 @@ -92,6 +92,7 @@ static int (*K_SSL_CTX_use_certificate) static int (*K_SSL_get_error) (SSL*, int) = NULL; static STACK_OF(X509)* (*K_SSL_get_peer_cert_chain) (SSL*) = NULL; static void (*K_X509_STORE_CTX_set_chain) (X509_STORE_CTX *, STACK_OF(X509)*) = NULL; +static void (*K_X509_STORE_CTX_set_purpose) (X509_STORE_CTX *, int) = NULL; static void (*K_sk_free) (STACK*) = NULL; static int (*K_sk_num) (STACK*) = NULL; static char* (*K_sk_value) (STACK*, int) = NULL; @@ -254,6 +255,7 @@ KConfig *cfg; X509**, STACK_OF(X509)**)) _cryptoLib->symbol("PKCS12_parse"); K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) _cryptoLib->symbol("EVP_PKEY_free"); K_X509_STORE_CTX_set_chain = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) _cryptoLib->symbol("X509_STORE_CTX_set_chain"); + K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) _cryptoLib->symbol("X509_STORE_CTX_set_purpose"); K_sk_free = (void (*) (STACK *)) _cryptoLib->symbol("sk_free"); K_sk_num = (int (*) (STACK *)) _cryptoLib->symbol("sk_num"); K_sk_value = (char* (*) (STACK *, int)) _cryptoLib->symbol("sk_value"); @@ -742,6 +744,10 @@ char *KOpenSSLProxy::sk_value(STACK *s, void KOpenSSLProxy::X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x) { if (K_X509_STORE_CTX_set_chain) (K_X509_STORE_CTX_set_chain)(v,x); +} + +void KOpenSSLProxy::X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose) { + if (K_X509_STORE_CTX_set_purpose) (K_X509_STORE_CTX_set_purpose)(v,purpose); } Index: kopenssl.h =================================================================== RCS file: /home/kde/kdelibs/kssl/Attic/kopenssl.h,v retrieving revision 1.15 diff -u -p -r1.15 kopenssl.h --- kopenssl.h 2001/07/27 09:55:02 1.15 +++ kopenssl.h 2002/08/12 20:53:43 @@ -277,6 +277,10 @@ public: */ void X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x); + /* + * X509_STORE_CTX_set_purpose - set the purpose of the certificate + */ + void X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose); /* * X509_verify_cert - verify the certificate Index: ksslcertificate.cc =================================================================== RCS file: /home/kde/kdelibs/kssl/Attic/ksslcertificate.cc,v retrieving revision 1.39.2.6 diff -u -p -r1.39.2.6 ksslcertificate.cc --- ksslcertificate.cc 2001/10/25 06:12:11 1.39.2.6 +++ ksslcertificate.cc 2002/08/12 20:53:43 @@ -262,6 +262,8 @@ KSSLCertificate::KSSLValidation KSSLCert // FIXME: do all the X509_STORE_CTX_set_flags(); here // +-----> Note that this is for 0.9.6 or better ONLY! + d->kossl->X509_STORE_CTX_set_purpose(certStoreCTX, X509_PURPOSE_SSL_SERVER); + //kdDebug(7029) << "KSSL verifying.............." << endl; certStoreCTX->error = X509_V_OK; rc = d->kossl->X509_verify_cert(certStoreCTX);