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

scmno****@osdn***** scmno****@osdn*****
2019年 7月 21日 (日) 18:27:27 JST


Revision: 7873
          https://osdn.net/projects/ttssh2/scm/svn/commits/7873
Author:   yutakapon
Date:     2019-07-21 18:27:26 +0900 (Sun, 21 Jul 2019)
Log Message:
-----------
単体テスト完了した箇所のコメントを除去した。
単体テストがしやすいように、EVP_Cipher()の返り値を変数に代入するようにした。
チケット #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/key.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-20 15:19:04 UTC (rev 7872)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/crypt.c	2019-07-21 09:27:26 UTC (rev 7873)
@@ -261,7 +261,6 @@
 	unsigned char lastiv[1];
 	char tmp[80];
 	EVP_CIPHER_CTX *evp = pvar->evpcip[MODE_IN];
-	/********* OPENSSL1.1.1 NOTEST *********/
 
 	if (bytes == 0)
 		return TRUE;

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c	2019-07-20 15:19:04 UTC (rev 7872)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c	2019-07-21 09:27:26 UTC (rev 7873)
@@ -272,7 +272,6 @@
                    u_char *signature, u_int signaturelen,
                    u_char *data, u_int datalen)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	const EVP_MD *evp_md;
 	EVP_MD_CTX *md = NULL;
 	//	char *ktype;
@@ -283,7 +282,6 @@
 	char *ptr;
 	BIGNUM *n;
 
-	/********* OPENSSL1.1.1 NOTEST *********/
 	md = EVP_MD_CTX_new();
 	if (md == NULL) {
 		ret = -1;

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-20 15:19:04 UTC (rev 7872)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-21 09:27:26 UTC (rev 7873)
@@ -386,6 +386,7 @@
 	SSH2Cipher *cipher;
 	size_t authlen;
 	EVP_CIPHER_CTX *cipher_ctx = NULL;
+	int ret;
 
 	blob = buffer_init();
 	b = buffer_init();
@@ -392,7 +393,6 @@
 	kdf = buffer_init();
 	encoded = buffer_init();
 	copy_consumed = buffer_init();
-	/********* OPENSSL1.1.1 NOTEST *********/
 	cipher_ctx = EVP_CIPHER_CTX_new();
 
 	if (blob == NULL || b == NULL || kdf == NULL || encoded == NULL || copy_consumed == NULL || cipher_ctx == NULL)
@@ -554,12 +554,12 @@
 		}
 	}
 
-	/********* OPENSSL1.1.1 NOTEST *********/
 	// \x95\x9C\x8D\x86\x89\xBB
 	cp = buffer_append_space(b, len);
 	cipher_init_SSH2(cipher_ctx, key, keylen, key + keylen, ivlen, CIPHER_DECRYPT, 
 		get_cipher_EVP_CIPHER(cipher), 0, 0, pvar);
-	if (EVP_Cipher(cipher_ctx, cp, buffer_tail_ptr(copy_consumed), len) == 0) {
+	ret = EVP_Cipher(cipher_ctx, cp, buffer_tail_ptr(copy_consumed), len);
+	if (ret == 0) {
 		cipher_cleanup_SSH2(cipher_ctx);
 		goto error;
 	}
@@ -619,7 +619,6 @@
 	free(salt);
 	free(comment);
 
-	/********* OPENSSL1.1.1 NOTEST *********/
 	if (cipher_ctx) {
 		EVP_CIPHER_CTX_free(cipher_ctx);
 	}


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