[Ttssh2-commit] [7234] ttssh2 とりあえずコンパイルできる程度に修正

scmno****@osdn***** scmno****@osdn*****
2018年 9月 8日 (土) 03:51:32 JST


Revision: 7234
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7234
Author:   zmatsuo
Date:     2018-09-08 03:51:32 +0900 (Sat, 08 Sep 2018)
Log Message:
-----------
ttssh2 とりあえずコンパイルできる程度に修正
- __FUNCTION__ は消すなどとりあえずの対応
- 型の誤りなどがあったので修正

Modified Paths:
--------------
    branches/cmake/libs/lib_openssl.cmake
    branches/cmake/ttssh2/ttxssh/CMakeLists.txt
    branches/cmake/ttssh2/ttxssh/buffer.c
    branches/cmake/ttssh2/ttxssh/fwd-socks.c
    branches/cmake/ttssh2/ttxssh/fwd.c
    branches/cmake/ttssh2/ttxssh/key.c
    branches/cmake/ttssh2/ttxssh/key.h
    branches/cmake/ttssh2/ttxssh/keyfiles.c
    branches/cmake/ttssh2/ttxssh/ssh.c

-------------- next part --------------
Modified: branches/cmake/libs/lib_openssl.cmake
===================================================================
--- branches/cmake/libs/lib_openssl.cmake	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/libs/lib_openssl.cmake	2018-09-07 18:51:32 UTC (rev 7234)
@@ -7,7 +7,7 @@
 	)
 
   set(OPENSSL_LIB
-	${CMAKE_CURRENT_LIST_DIR}/openssl_${TOOLSET}/lib/libeay32.lib
+	${CMAKE_CURRENT_LIST_DIR}/openssl_${TOOLSET}/lib/libcrypto.a
   )
 
 else()

Modified: branches/cmake/ttssh2/ttxssh/CMakeLists.txt
===================================================================
--- branches/cmake/ttssh2/ttxssh/CMakeLists.txt	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/CMakeLists.txt	2018-09-07 18:51:32 UTC (rev 7234)
@@ -99,6 +99,12 @@
   ${ZLIB_LIBRARY_DIRS}
   )
 
+if(MINGW)
+  link_directories(
+	${CMAKE_SOURCE_DIR}/teraterm/htmlhelp
+	)
+endif()
+
 add_library(
   ttxssh SHARED
   ${SRC}
@@ -109,6 +115,12 @@
   PRIVATE -DTTPCMN_IMPORT
   )
 
+set_target_properties(
+  ttxssh
+  PROPERTIES
+  PREFIX ""
+  )
+
 target_link_libraries(
   ttxssh
   libputty

Modified: branches/cmake/ttssh2/ttxssh/buffer.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/buffer.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/buffer.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -38,6 +38,10 @@
 #include <openssl/ec.h>
 #include <zlib.h>
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 // \x83o\x83b\x83t\x83@\x82̃I\x83t\x83Z\x83b\x83g\x82\xF0\x8F\x89\x8A\x{227B0B5}\x81A\x82܂\xBE\x93ǂ\xF1\x82ł\xA2\x82Ȃ\xA2\x8F\xF3\x91Ԃɂ\xB7\x82\xE9\x81B
 // Tera Term(TTSSH)\x83I\x83\x8A\x83W\x83i\x83\x8B\x8A֐\x94\x81B
 void buffer_rewind(buffer_t *buf)

Modified: branches/cmake/ttssh2/ttxssh/fwd-socks.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/fwd-socks.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/fwd-socks.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -65,6 +65,10 @@
 #define SOCKS5_ERROR_COMMAND     129
 #define SOCKS5_ERROR_ADDRTYPE    130
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 typedef struct {
 	PTInstVar pvar;
 

Modified: branches/cmake/ttssh2/ttxssh/fwd.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/fwd.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/fwd.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -47,6 +47,10 @@
 
 #define CHANNEL_READ_BUF_SIZE 8192
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam,
                                         LPARAM lParam);
 

Modified: branches/cmake/ttssh2/ttxssh/key.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/key.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/key.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -592,7 +592,7 @@
 	return TRUE;
 }
 
-char* key_fingerprint_raw(Key *k, enum digest_algorithm dgst_alg, int *dgst_raw_length)
+char* key_fingerprint_raw(Key *k, digest_algorithm dgst_alg, int *dgst_raw_length)
 {
 	const EVP_MD *md = NULL;
 	EVP_MD_CTX ctx;
@@ -879,7 +879,7 @@
 //
 // fingerprint\x81i\x8Ew\x96\xE4\x81F\x83z\x83X\x83g\x8C\xF6\x8AJ\x8C\xAE\x82̃n\x83b\x83V\x83\x85\x81j\x82𐶐\xAC\x82\xB7\x82\xE9
 //
-char *key_fingerprint(Key *key, enum fp_rep dgst_rep, enum digest_algorithm dgst_alg)
+char *key_fingerprint(Key *key, enum fp_rep dgst_rep, digest_algorithm dgst_alg)
 {
 	char *retval = NULL, *alg;
 	unsigned char *dgst_raw;

Modified: branches/cmake/ttssh2/ttxssh/key.h
===================================================================
--- branches/cmake/ttssh2/ttxssh/key.h	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/key.h	2018-09-07 18:51:32 UTC (rev 7234)
@@ -43,12 +43,12 @@
 unsigned char *duplicate_ED25519_PK(unsigned char *src);
 BOOL key_copy(Key *dest, Key *src);
 
-char *key_fingerprint_raw(Key *k, enum digest_algorithm dgst_alg, int *dgst_raw_length);
-char *key_fingerprint(Key *key, enum fp_rep dgst_rep, enum fp_type dgst_type);
+char *key_fingerprint_raw(Key *k, digest_algorithm dgst_alg, int *dgst_raw_length);
+char *key_fingerprint(Key *key, enum fp_rep dgst_rep, digest_algorithm dgst_alg);
 
 const char *ssh_key_type(ssh_keytype type);
 char *get_sshname_from_key(Key *key);
-enum hostkey_type get_keytype_from_name(char *name);
+ssh_keytype get_keytype_from_name(char *name);
 char *curve_keytype_to_name(ssh_keytype type);
 ssh_keytype key_curve_name_to_keytype(char *name);
 

Modified: branches/cmake/ttssh2/ttxssh/keyfiles.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/keyfiles.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/keyfiles.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -50,6 +50,10 @@
 
 #include "cipher.h"
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 static char ID_string[] = "SSH PRIVATE KEY FILE FORMAT 1.1\n";
 
 static BIGNUM *get_bignum(unsigned char *bytes)
@@ -454,7 +458,7 @@
 	ciphername = buffer_get_string_msg(copy_consumed, NULL);
 	cipher = get_cipher_by_name(ciphername);
 	if (cipher == NULL && strcmp(ciphername, "none") != 0) {
-		logprintf(LOG_LEVEL_ERROR, "%s: unknown cipher name", __FUNCTION__);
+		logprintf(LOG_LEVEL_ERROR, __FUNCTION__ ": unknown cipher name");
 		goto error;
 	}
 	// \x83p\x83X\x83t\x83\x8C\x81[\x83Y\x82̃`\x83F\x83b\x83N\x81B\x88Í\x86\x89\xBB\x82\xAA none \x82łȂ\xA2\x8Fꍇ\x82͋\xF3\x82̃p\x83X\x83\x8F\x81[\x83h\x82\xF0\x94F\x82߂Ȃ\xA2\x81B

Modified: branches/cmake/ttssh2/ttxssh/ssh.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/ssh.c	2018-09-07 18:51:22 UTC (rev 7233)
+++ branches/cmake/ttssh2/ttxssh/ssh.c	2018-09-07 18:51:32 UTC (rev 7234)
@@ -83,6 +83,10 @@
 //
 #define NonNull(msg) ((msg)?(msg):"(null)")
 
+#if defined(__MINGW32__)
+#define __FUNCTION__
+#endif
+
 typedef enum {
 	GetPayloadError = 0,
 	GetPayloadOK = 1,
@@ -181,7 +185,7 @@
 // channel function
 //
 static Channel_t *ssh2_channel_new(unsigned int window, unsigned int maxpack,
-                                   enum confirm_type type, int local_num)
+                                   enum channel_type type, int local_num)
 {
 	int i, found;
 	Channel_t *c;
@@ -3806,7 +3810,7 @@
 		auth_data_ptr = outmsg + 8 + protocol_len;
 		for (i = 0; i < auth_data_len; i++) {
 			_snprintf_s(auth_data_ptr + i * 2,
-			            outmsg_len - (auth_data_ptr - outmsg) - i * 2,
+			            outmsg_len - ((UINT_PTR)auth_data_ptr - (UINT_PTR)outmsg) - i * 2,
 			            _TRUNCATE, "%.2x", auth_data[i]);
 		}
 		set_uint32(outmsg + 8 + protocol_len + data_len, screen_num);
@@ -5831,7 +5835,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+		            __FUNCTION__ ": type mismatch for decoded server_host_key_blob (kex:%s blob:%s)",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -5974,7 +5978,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+		            __FUNCTION__ ": type mismatch for decoded server_host_key_blob (kex:%s blob:%s)",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;
@@ -6123,7 +6127,7 @@
 	// known_hosts\x91Ή\x9E (2006.3.20 yutaka)
 	if (hostkey->type != pvar->hostkey_type) {  // \x83z\x83X\x83g\x83L\x81[\x82̎\xED\x95ʔ\xE4\x8Ar
 		_snprintf_s(emsg_tmp, sizeof(emsg_tmp), _TRUNCATE,
-		            "%s: type mismatch for decoded server_host_key_blob (kex:%s blob:%s)", __FUNCTION__,
+					__FUNCTION__ ": type mismatch for decoded server_host_key_blob (kex:%s blob:%s)",
 		            get_ssh_keytype_name(pvar->hostkey_type), get_ssh_keytype_name(hostkey->type));
 		emsg = emsg_tmp;
 		goto error;



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