diff options
| author | Anton <anton@picapica> | 2019-05-26 02:18:02 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2019-05-26 02:18:02 +0400 |
| commit | da5882b9786fd364be48e0a3669bb29f0186e5ca (patch) | |
| tree | da0b65686fa0caa7531eb15aed977c41e772610b /PICA_client.c | |
| parent | 62ba88a187fa98de39dd12093c214013128ed866 (diff) | |
| download | pica-pica-da5882b9786fd364be48e0a3669bb29f0186e5ca.tar.gz pica-pica-da5882b9786fd364be48e0a3669bb29f0186e5ca.zip | |
OpenSSL compatibility fixes, makes source buildable with OpenSSL 1.1.0
Diffstat (limited to 'PICA_client.c')
| -rw-r--r-- | PICA_client.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/PICA_client.c b/PICA_client.c index 3606c6e..d589137 100644 --- a/PICA_client.c +++ b/PICA_client.c @@ -196,19 +196,6 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) X509_verify_cert_error_string(err), depth, buf); } - - /* - * At this point, err contains the last verification error. We can use - * it for something special - */ - if (!preverify_ok && (err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT)) - { - X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256); - printf("issuer= %s\n", buf); - } - - - return preverify_ok; } @@ -382,8 +369,11 @@ static int verify_peer_cert_common(X509 **peer_cert, SSL *ssl, const unsigned ch return PICA_ERRNOPEERCERT; rsa = EVP_PKEY_get1_RSA(pubkey); - +#if OPENSSL_VERSION_NUMBER < 0x10100000L if (!rsa || !rsa->n || BN_num_bits(rsa->n) < PICA_RSA_MINKEYSIZE) +#else + if (!rsa || RSA_bits(rsa) < PICA_RSA_MINKEYSIZE) +#endif return PICA_ERRNOPEERCERT; RSA_free(rsa); |
