summaryrefslogtreecommitdiff
path: root/sysutils/rsyncrypto/files/patch-crypto.cpp
blob: 1a6d439b22982b38920cd82e8995f4ff426c8a42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- crypto.cpp.orig	2016-11-11 20:23:00 UTC
+++ crypto.cpp
@@ -155,9 +155,13 @@ std::unique_ptr<key> decrypt_header( file_t fromfd, RS
     unsigned char *buff=filemap.get_uc()+sizeof(HEADER_ENCRYPTION_VERSION);
     auto_array<unsigned char> decrypted(new unsigned char[headsize]);
 
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+    if( (prv->p==nullptr || prv->q==nullptr) ) {
+#else
     const BIGNUM *p, *q;
     RSA_get0_factors(prv, &p, &q);
     if( (p==nullptr || q==nullptr) ) {
+#endif
         // This is not a private key!
         throw rscerror("Neither AES session key nor RSA private key present - cannot decrypt using only public key");
     }