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 | |
| parent | 62ba88a187fa98de39dd12093c214013128ed866 (diff) | |
| download | pica-pica-da5882b9786fd364be48e0a3669bb29f0186e5ca.tar.gz pica-pica-da5882b9786fd364be48e0a3669bb29f0186e5ca.zip | |
OpenSSL compatibility fixes, makes source buildable with OpenSSL 1.1.0
| -rw-r--r-- | PICA_client.c | 18 | ||||
| -rw-r--r-- | configure.ac | 2 |
2 files changed, 5 insertions, 15 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); diff --git a/configure.ac b/configure.ac index 66b4f32..8381a2a 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ AS_IF([test "x$qt_version" = xqt5], # Checks for common libraries, required by both pica-node and pica-client AC_SEARCH_LIBS([dlopen], [dl]) AC_CHECK_LIB([crypto], [RAND_add],[],[AC_MSG_ERROR(["libcrypto from OpenSSL package not found"])],[ -lz ]) -AC_CHECK_LIB([ssl], [SSL_library_init],[],[AC_MSG_ERROR(["libssl from OpenSSL package not found"])]) +AC_CHECK_LIB([ssl], [SSL_new],[],[AC_MSG_ERROR(["libssl from OpenSSL package not found"])]) AC_CHECK_LIB([pthread], [pthread_create]) #checking if pica-node is disabled |
