[Chinese-commits] [fqterm] 27/34: fqterm_ssh2_kex.cpp: use RSA_set0_key for OpenSSL 1.1.0
Boyuan Yang
hosiet-guest at moszumanska.debian.org
Tue Nov 1 06:06:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
hosiet-guest pushed a commit to branch master
in repository fqterm.
commit 7b07a2f69ce43856c35e44b1a0ed3410ae2075d5
Author: Iru Cai <mytbk920423 at gmail.com>
Date: Sat Oct 29 15:00:30 2016 +0800
fqterm_ssh2_kex.cpp: use RSA_set0_key for OpenSSL 1.1.0
---
src/protocol/internal/fqterm_ssh2_kex.cpp | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/protocol/internal/fqterm_ssh2_kex.cpp b/src/protocol/internal/fqterm_ssh2_kex.cpp
index 53026e9..8c6f240 100644
--- a/src/protocol/internal/fqterm_ssh2_kex.cpp
+++ b/src/protocol/internal/fqterm_ssh2_kex.cpp
@@ -29,6 +29,7 @@
#include "fqterm_ssh2_kex.h"
#include "fqterm_ssh_md5.h"
#include "fqterm_trace.h"
+#include "ssh_pubkey_crypto.h"
namespace FQTerm {
@@ -259,7 +260,7 @@ bool FQTermSSH2Kex::verifyKey() {
static RSA *CreateRSAContext(unsigned char *host_key, int len) {
FQTermSSHBuffer buffer(len);
-
+
buffer.putRawData((char *)host_key, len);
int algo_len = -1;
@@ -275,12 +276,18 @@ static RSA *CreateRSAContext(unsigned char *host_key, int len) {
RSA *rsa = RSA_new();
- rsa->e = BN_new();
- BN_bin2bn(e, e_len, rsa->e);
-
- rsa->n = BN_new();
- BN_bin2bn(n, n_len, rsa->n);
-
+ BIGNUM *rsa_e = BN_new();
+ BIGNUM *rsa_n = BN_new();
+
+ BN_bin2bn(e, e_len, rsa_e);
+ BN_bin2bn(n, n_len, rsa_n);
+
+#ifdef HAVE_OPAQUE_STRUCTS
+ RSA_set0_key(rsa, rsa_n, rsa_e, NULL);
+#else
+ rsa->n = rsa_n;
+ rsa->e = rsa_e;
+#endif
delete[] algo;
delete[] e;
delete[] n;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/chinese/fqterm.git
More information about the Chinese-commits
mailing list