if(!list.isEmpty()) { X509_STORE *store = SSL_CTX_get_cert_store(context); QPtrListIterator<QCA_CertContext> it(list); for(CertContext *cc; (cc = (CertContext *)it.current()); ++it) X509_STORE_add_cert(store, cc->x);
else { if(!EVP_DecryptInit(&c, type, NULL, NULL)) return false; if(keysize != type->key_len) EVP_CIPHER_CTX_set_key_length(&c, keysize); if(!EVP_DecryptInit(&c, NULL, (unsigned char *)key, (unsigned char *)iv)) return false;
	bool setup(const QPtrList<QCA_CertContext> &list, const QCA_CertContext &cc, const QCA_RSAKeyContext &kc)	{		context = SSL_CTX_new(method);		if(!context) {			reset();			return false;		}		// load the cert store		if(!list.isEmpty()) {			X509_STORE *store = SSL_CTX_get_cert_store(context);			QPtrListIterator<QCA_CertContext> it(list);			for(CertContext *cc; (cc = (CertContext *)it.current()); ++it)				X509_STORE_add_cert(store, cc->x);		}		ssl = SSL_new(context);		if(!ssl) {			reset();			return false;		}		SSL_set_ssl_method(ssl, method); // can this return error?		// setup the memory bio		rbio = BIO_new(BIO_s_mem());		wbio = BIO_new(BIO_s_mem());		// this passes control of the bios to ssl.  we don't need to free them.		SSL_set_bio(ssl, rbio, wbio);		// setup the cert to send		if(!cc.isNull() && !kc.isNull()) {			cert = static_cast<CertContext*>(cc.clone());			key = static_cast<RSAKeyContext*>(kc.clone());			if(SSL_use_certificate(ssl, cert->x) != 1) {				reset();				return false;			}			if(SSL_use_RSAPrivateKey(ssl, key->sec) != 1) {				reset();				return false;			}		}		return true;	}