[Ttssh2-commit] [7891] 単体テスト完了した箇所のコメントを除去した。

scmno****@osdn***** scmno****@osdn*****
2019年 7月 28日 (日) 00:31:49 JST


Revision: 7891
          https://osdn.net/projects/ttssh2/scm/svn/commits/7891
Author:   yutakapon
Date:     2019-07-28 00:31:49 +0900 (Sun, 28 Jul 2019)
Log Message:
-----------
単体テスト完了した箇所のコメントを除去した。
normalize_key()でRSA構造体のスワップ方法を間違えていたのを修正した。
チケット #36876 

Ticket Links:
------------
    https://osdn.net/projects/ttssh2/tracker/detail/36876

Modified Paths:
--------------
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/crypt.c
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c

-------------- next part --------------
Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/crypt.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/crypt.c	2019-07-27 12:13:15 UTC (rev 7890)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/crypt.c	2019-07-27 15:31:49 UTC (rev 7891)
@@ -959,7 +959,6 @@
                                           int challenge_len,
                                           unsigned char *response)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	int server_key_bits;
 	int host_key_bits;
 	int server_key_bytes;

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-27 12:13:15 UTC (rev 7890)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-27 15:31:49 UTC (rev 7891)
@@ -66,22 +66,19 @@
    key must be discarded. */
 static BOOL normalize_key(RSA *key)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	BOOL OK = FALSE;
 	BIGNUM *r = BN_new();
 	BN_CTX *ctx = BN_CTX_new();
 	BIGNUM *e, *n, *d, *dmp1, *dmq1, *iqmp, *p, *q;
 
+	e = n = d = dmp1 = dmq1 = iqmp = p = q = NULL;
+
 	RSA_get0_key(key, &n, &e, &d);
 	RSA_get0_factors(key, &p, &q);
 	RSA_get0_crt_params(key, &dmp1, &dmq1, &iqmp);
 
 	if (BN_cmp(p, q) < 0) {
-		BIGNUM *tmp = p;
-
-		p = q;
-		q = tmp;
-		RSA_set0_factors(key, p, q);
+		BN_swap(p, q);
 	}
 
 	if (r != NULL && ctx != NULL) {
@@ -110,7 +107,6 @@
                                  BOOL * invalid_passphrase,
                                  BOOL is_auto_login)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	char filename[2048];
 	int fd;
 	unsigned int length, amount_read;


Ttssh2-commit メーリングリストの案内