[ttssh2-commit] [10529] ttssh2 プロトタイプをヘッダに移動

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 1月 22日 (日) 02:41:55 JST


Revision: 10529
          https://osdn.net/projects/ttssh2/scm/svn/commits/10529
Author:   zmatsuo
Date:     2023-01-22 02:41:55 +0900 (Sun, 22 Jan 2023)
Log Message:
-----------
ttssh2 プロトタイプをヘッダに移動

- cipher-3des1.h, cipher-ctr.h を追加
- cipher-3des1.c, cipher-ctr.c の関数のプロトタイプを h へ移動

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/CMakeLists.txt
    trunk/ttssh2/ttxssh/cipher-3des1.c
    trunk/ttssh2/ttxssh/cipher-ctr.c
    trunk/ttssh2/ttxssh/cipher.c
    trunk/ttssh2/ttxssh/ssh.h
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj.filters
    trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj
    trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj.filters

Added Paths:
-----------
    trunk/ttssh2/ttxssh/cipher-3des1.h
    trunk/ttssh2/ttxssh/cipher-ctr.h

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/CMakeLists.txt
===================================================================
--- trunk/ttssh2/ttxssh/CMakeLists.txt	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/CMakeLists.txt	2023-01-21 17:41:55 UTC (rev 10529)
@@ -31,9 +31,11 @@
   chacha.c
   chacha.h
   cipher-3des1.c
+  cipher-3des1.h
   cipher-chachapoly-libcrypto.c
   cipher-chachapoly.h
   cipher-ctr.c
+  cipher-ctr.h
   cipher.c
   cipher.h
   comp.c

Modified: trunk/ttssh2/ttxssh/cipher-3des1.c
===================================================================
--- trunk/ttssh2/ttxssh/cipher-3des1.c	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/cipher-3des1.c	2023-01-21 17:41:55 UTC (rev 10529)
@@ -32,6 +32,8 @@
 
 #include "ssherr.h"
 
+#include "cipher-3des1.h"
+
 /*
  * This is used by SSH1:
  *
@@ -51,8 +53,6 @@
 	EVP_CIPHER_CTX  *k1, *k2, *k3;
 };
 
-const EVP_CIPHER * evp_ssh1_3des(void);
-
 static int ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, int enc)
 {
 	struct ssh1_3des_ctx *c;

Added: trunk/ttssh2/ttxssh/cipher-3des1.h
===================================================================
--- trunk/ttssh2/ttxssh/cipher-3des1.h	                        (rev 0)
+++ trunk/ttssh2/ttxssh/cipher-3des1.h	2023-01-21 17:41:55 UTC (rev 10529)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023- TeraTerm Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+const EVP_CIPHER* evp_ssh1_3des(void);

Modified: trunk/ttssh2/ttxssh/cipher-ctr.c
===================================================================
--- trunk/ttssh2/ttxssh/cipher-ctr.c	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/cipher-ctr.c	2023-01-21 17:41:55 UTC (rev 10529)
@@ -31,8 +31,7 @@
 #include <openssl/cast.h>
 #include <openssl/camellia.h>
 
-extern const EVP_CIPHER *evp_aes_128_ctr(void);
-extern const EVP_CIPHER *evp_camellia_128_ctr(void);
+#include "cipher-ctr.h"
 
 struct ssh_aes_ctr_ctx
 {

Added: trunk/ttssh2/ttxssh/cipher-ctr.h
===================================================================
--- trunk/ttssh2/ttxssh/cipher-ctr.h	                        (rev 0)
+++ trunk/ttssh2/ttxssh/cipher-ctr.h	2023-01-21 17:41:55 UTC (rev 10529)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023- TeraTerm Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+const EVP_CIPHER *evp_aes_128_ctr(void);
+const EVP_CIPHER *evp_des3_ctr(void);
+const EVP_CIPHER *evp_bf_ctr(void);
+const EVP_CIPHER *evp_cast5_ctr(void);
+const EVP_CIPHER *evp_camellia_128_ctr(void);

Modified: trunk/ttssh2/ttxssh/cipher.c
===================================================================
--- trunk/ttssh2/ttxssh/cipher.c	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/cipher.c	2023-01-21 17:41:55 UTC (rev 10529)
@@ -37,8 +37,8 @@
 
 #include "codeconv.h"
 
-// from cipher-3des.c
-extern const EVP_CIPHER* evp_ssh1_3des(void);
+#include "cipher-3des1.h"
+#include "cipher-ctr.h"
 
 static const struct ssh2cipher ssh2_ciphers[] = {
 	{SSH2_CIPHER_3DES_CBC,        "3des-cbc",         8, 24,    0, 0, 0, EVP_des_ede3_cbc},     // RFC4253
@@ -97,7 +97,7 @@
 u_int get_cipher_block_size(const struct ssh2cipher *cipher)
 {
 	u_int blocksize = 0;
-	
+
 	if (cipher) {
 		blocksize = cipher->block_size;
 	}
@@ -202,7 +202,7 @@
 	case SSH_CIPHER_BLOWFISH:
 		return "Blowfish (256 key bits)";
 
-	// SSH2 
+	// SSH2
 	case SSH2_CIPHER_3DES_CBC:
 		return "3des-cbc";
 	case SSH2_CIPHER_AES128_CBC:

Modified: trunk/ttssh2/ttxssh/ssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ssh.h	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ssh.h	2023-01-21 17:41:55 UTC (rev 10529)
@@ -53,13 +53,6 @@
 	count++; \
 }
 
-// from OpenSSH
-extern const EVP_CIPHER *evp_aes_128_ctr(void);
-extern const EVP_CIPHER *evp_des3_ctr(void);
-extern const EVP_CIPHER *evp_bf_ctr(void);
-extern const EVP_CIPHER *evp_cast5_ctr(void);
-extern const EVP_CIPHER *evp_camellia_128_ctr(void);
-
 /* Some of this code has been adapted from Ian Goldberg's Pilot SSH */
 
 typedef enum {
@@ -536,7 +529,7 @@
 
 typedef struct scp {
 	enum scp_dir dir;              // transfer direction
-	enum scp_state state;          // SCP state 
+	enum scp_state state;          // SCP state
 	char localfile[MAX_PATH];      // local filename
 	char localfilefull[MAX_PATH];  // local filename fullpath
 	char remotefile[MAX_PATH];     // remote filename
@@ -556,7 +549,7 @@
 } scp_t;
 
 enum sftp_state {
-	SFTP_INIT, SFTP_CONNECTED, SFTP_REALPATH, 
+	SFTP_INIT, SFTP_CONNECTED, SFTP_REALPATH,
 };
 
 typedef struct sftp {

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2023-01-21 17:41:55 UTC (rev 10529)
@@ -100,9 +100,6 @@
 
 #include "libputty.h"
 
-// from cipher-3des.c
-extern const EVP_CIPHER* evp_ssh1_3des(void);
-
 #undef DialogBoxParam
 #define DialogBoxParam(p1,p2,p3,p4,p5) \
 	TTDialogBoxParam(p1,p2,p3,p4,p5)

Modified: trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj	2023-01-21 17:41:55 UTC (rev 10529)
@@ -188,6 +188,8 @@
     <ClInclude Include="auth.h" />
     <ClInclude Include="buffer.h" />
     <ClInclude Include="chacha.h" />
+    <ClInclude Include="cipher-3des1.h" />
+    <ClInclude Include="cipher-ctr.h" />
     <ClInclude Include="cipher.h" />
     <ClInclude Include="cipher-chachapoly.h" />
     <ClInclude Include="comp.h" />

Modified: trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj.filters
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj.filters	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ttxssh.v16.vcxproj.filters	2023-01-21 17:41:55 UTC (rev 10529)
@@ -243,6 +243,12 @@
     <ClInclude Include="..\..\teraterm\common\ttlib.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="cipher-3des1.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="cipher-ctr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Image Include="ttsecure.ico">

Modified: trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj	2023-01-21 17:41:55 UTC (rev 10529)
@@ -188,6 +188,8 @@
     <ClInclude Include="auth.h" />
     <ClInclude Include="buffer.h" />
     <ClInclude Include="chacha.h" />
+    <ClInclude Include="cipher-3des1.h" />
+    <ClInclude Include="cipher-ctr.h" />
     <ClInclude Include="cipher.h" />
     <ClInclude Include="cipher-chachapoly.h" />
     <ClInclude Include="comp.h" />

Modified: trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj.filters
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj.filters	2023-01-21 17:41:45 UTC (rev 10528)
+++ trunk/ttssh2/ttxssh/ttxssh.v17.vcxproj.filters	2023-01-21 17:41:55 UTC (rev 10529)
@@ -243,6 +243,12 @@
     <ClInclude Include="..\..\teraterm\common\ttlib.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="cipher-3des1.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="cipher-ctr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Image Include="ttsecure.ico">


ttssh2-commit メーリングリストの案内
Back to archive index