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

scmno****@osdn***** scmno****@osdn*****
2019年 7月 21日 (日) 21:11:02 JST


Revision: 7874
          https://osdn.net/projects/ttssh2/scm/svn/commits/7874
Author:   yutakapon
Date:     2019-07-21 21:11:01 +0900 (Sun, 21 Jul 2019)
Log Message:
-----------
単体テスト完了した箇所のコメントを除去した。
「OPENSSL1.1.1 ERROR CHECK」コメントにチケット番号を追記した。
ssh1_3des_iv()は未使用であることのコメントを追記した。
チケット #36876 

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

Modified Paths:
--------------
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/cipher-ctr.c
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c
    branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/cipher-ctr.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/cipher-ctr.c	2019-07-21 09:27:26 UTC (rev 7873)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/cipher-ctr.c	2019-07-21 12:11:01 UTC (rev 7874)
@@ -235,7 +235,7 @@
 
 	if (p == NULL) {
 		p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/DES_BLOCK_SIZE, /*key_len*/24);
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 	}
 	if (p) {
 		EVP_CIPHER_meth_set_iv_length(p, DES_BLOCK_SIZE);
@@ -348,7 +348,7 @@
 	/********* OPENSSL1.1.1 NOTEST *********/
 	if (p == NULL) {
 		p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/BF_BLOCK, /*key_len*/16);
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 	}
 	if (p) {
 		EVP_CIPHER_meth_set_iv_length(p, BF_BLOCK);
@@ -461,7 +461,7 @@
 
 	if (p == NULL) {
 		p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/CAST_BLOCK, /*key_len*/16);
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 	}
 	if (p) {
 		EVP_CIPHER_meth_set_iv_length(p, CAST_BLOCK);
@@ -566,7 +566,7 @@
 
 	if (p == NULL) {
 		p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/CAMELLIA_BLOCK_SIZE, /*key_len*/16);
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 	}
 	if (p) {
 		EVP_CIPHER_meth_set_iv_length(p, CAMELLIA_BLOCK_SIZE);

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c	2019-07-21 09:27:26 UTC (rev 7873)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/key.c	2019-07-21 12:11:01 UTC (rev 7874)
@@ -567,7 +567,6 @@
 //
 RSA *duplicate_RSA(RSA *src)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	RSA *rsa = NULL;
 	BIGNUM *e = NULL, *n = NULL;
 	BIGNUM *se = NULL, *sn = NULL;
@@ -1021,7 +1020,6 @@
 //
 static void key_add_private(Key *k)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	BIGNUM *d, *iqmp, *q, *p, *dmq1, *dmp1;
 	BIGNUM *priv_key = NULL;
 
@@ -1113,7 +1111,6 @@
 
 Key *key_new(int type)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	int success = 0;
 	Key *k = NULL;
 	RSA *rsa;
@@ -1589,7 +1586,6 @@
 		u_int slen, dlen, len;
 		int ok, nid = NID_sha1;
 
-		/********* OPENSSL1.1.1 NOTEST *********/
 		md = EVP_MD_CTX_new();
 		if (md == NULL)
 			goto error;
@@ -1647,7 +1643,6 @@
 	}
 	case KEY_DSA: // DSA
 	{
-		/********* OPENSSL1.1.1 NOTEST *********/
 		DSA_SIG *sig;
 		const EVP_MD *evp_md = EVP_sha1();
 		EVP_MD_CTX *md = NULL;
@@ -1655,7 +1650,6 @@
 		u_int rlen, slen, len, dlen;
 		BIGNUM *bignum_r, *bignum_s;
 
-		/********* OPENSSL1.1.1 NOTEST *********/
 		md = EVP_MD_CTX_new();
 		if (md == NULL)
 			goto error;
@@ -1789,7 +1783,6 @@
 
 BOOL get_SSH2_publickey_blob(PTInstVar pvar, buffer_t **blobptr, int *bloblen)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	buffer_t *msg = NULL;
 	Key *keypair;
 	char *s, *tmp;
@@ -1954,7 +1947,6 @@
 /* calculate p-1 and q-1 */
 static void rsa_generate_additional_parameters(RSA *rsa)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	BIGNUM *aux = NULL;
 	BN_CTX *ctx = NULL;
 	BIGNUM *e, *n, *d, *dmp1, *dmq1, *iqmp, *p, *q;
@@ -1983,7 +1975,6 @@
 
 Key *key_private_deserialize(buffer_t *blob)
 {
-	/********* OPENSSL1.1.1 NOTEST *********/
 	int success = 0;
 	char *type_name = NULL;
 	Key *k = NULL;

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-21 09:27:26 UTC (rev 7873)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/keyfiles.c	2019-07-21 12:11:01 UTC (rev 7874)
@@ -1528,7 +1528,7 @@
 
 		/********* OPENSSL1.1.1 NOTEST *********/
 		cipher_ctx = EVP_CIPHER_CTX_new();
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 
 		MD5_Init(&md);
 		MD5_Update(&md, passphrase, strlen(passphrase));

Modified: branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c	2019-07-21 09:27:26 UTC (rev 7873)
+++ branches/openssl_1_1_1_v2/ttssh2/ttxssh/ttxssh.c	2019-07-21 12:11:01 UTC (rev 7874)
@@ -147,7 +147,7 @@
 
 	pvar->evpcip[MODE_IN] = EVP_CIPHER_CTX_new();
 	pvar->evpcip[MODE_OUT] = EVP_CIPHER_CTX_new();
-	/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+	/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 }
 
 static void uninit_TTSSH(PTInstVar pvar)
@@ -3609,16 +3609,14 @@
 
 	if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
 		c = malloc(sizeof(*c));
-		/********* OPENSSL1.1.1 NOTEST *********/
 		c->k1 = EVP_CIPHER_CTX_new();
 		c->k2 = EVP_CIPHER_CTX_new();
 		c->k3 = EVP_CIPHER_CTX_new();
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 		EVP_CIPHER_CTX_set_app_data(ctx, c);
 	}
 	if (key == NULL)
 		return (1);
-	/********* OPENSSL1.1.1 NOTEST *********/
 	if (enc == -1)
 		enc = EVP_CIPHER_CTX_encrypting(ctx); // ctx->encrypt
 	k1 = k2 = k3 = (u_char *) key;
@@ -3654,7 +3652,6 @@
 		//error("ssh1_3des_cbc: no context");
 		return (0);
 	}
-	/********* OPENSSL1.1.1 NOTEST *********/
 	if (EVP_Cipher(c->k1, dest, (u_char *)src, len) == 0 ||
 		EVP_Cipher(c->k2, dest, dest, len) == 0 ||
 		EVP_Cipher(c->k3, dest, dest, len) == 0)
@@ -3677,6 +3674,7 @@
 	return (1);
 }
 
+// \x89\xBA\x8BL\x8A֐\x94\x82͖\xA2\x8Eg\x97p\x81B
 void ssh1_3des_iv(EVP_CIPHER_CTX *evp, int doset, u_char *iv, int len)
 {
 	struct ssh1_3des_ctx *c;
@@ -3689,7 +3687,6 @@
 		//fatal("%s: no 3des context", __func__);
 		;
 
-	/********* OPENSSL1.1.1 NOTEST *********/
 	if (doset) {
 		//debug3("%s: Installed 3DES IV", __func__);
 		memcpy(EVP_CIPHER_CTX_iv_noconst(c->k1), iv, 8);
@@ -3722,10 +3719,9 @@
 #endif
 	static EVP_CIPHER *p = NULL;
 
-	/********* OPENSSL1.1.1 NOTEST *********/
 	if (p == NULL) {
 		p = EVP_CIPHER_meth_new(NID_undef, /*block_size*/8, /*key_len*/16);
-		/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+		/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 	}
 	if (p) {
 		EVP_CIPHER_meth_set_iv_length(p, 0);
@@ -4098,7 +4094,6 @@
 	kdf = buffer_init();
 	encoded = buffer_init();
 	blob = buffer_init();
-	/********* OPENSSL1.1.1 NOTEST *********/
 	cipher_ctx = EVP_CIPHER_CTX_new();
 	if (b == NULL || kdf == NULL || encoded == NULL || blob == NULL || cipher_ctx == NULL)
 		goto ed25519_error;
@@ -4670,7 +4665,6 @@
 				int uulen;
 				BIGNUM *e, *n;
 				BIGNUM *p, *q, *g, *pub_key;
-				/********* OPENSSL1.1.1 NOTEST *********/
 
 				b = buffer_init();
 				if (b == NULL)
@@ -4868,7 +4862,6 @@
 				FILE *fp;
 				char wrapped[4096];
 				BIGNUM *e, *n, *d, *dmp1, *dmq1, *iqmp, *p, *q;
-				/********* OPENSSL1.1.1 NOTEST *********/
 
 				if (passphrase[0] == '\0') { // passphrase is empty
 					cipher_num = SSH_CIPHER_NONE;
@@ -4885,9 +4878,8 @@
 					break;
 				}
 
-				/********* OPENSSL1.1.1 NOTEST *********/
 				cipher_ctx = EVP_CIPHER_CTX_new();
-				/*** TODO: OPENSSL1.1.1 ERROR CHECK ***/
+				/*** TODO: OPENSSL1.1.1 ERROR CHECK(ticket#39335\x82ŏ\x88\x92u\x97\\x92\xE8) ***/
 
 				// set random value
 				rnd = arc4random();
@@ -4937,7 +4929,6 @@
 				MD5_Init(&md);
 				MD5_Update(&md, (const unsigned char *)passphrase, strlen(passphrase));
 				MD5_Final(digest, &md);
-				/********* OPENSSL1.1.1 NOTEST *********/
 				if (cipher_num == SSH_CIPHER_NONE) {
 					cipher_init_SSH2(cipher_ctx, digest, 16, NULL, 0, CIPHER_ENCRYPT, EVP_enc_null(), 0, 0, pvar);
 				} else {
@@ -4979,7 +4970,6 @@
 error:;
 				buffer_free(b);
 				buffer_free(enc);
-				/********* OPENSSL1.1.1 NOTEST *********/
 				if (cipher_ctx) {
 					EVP_CIPHER_CTX_free(cipher_ctx);
 				}


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