[Ttssh2-commit] [5528] get_cipher_by_name() を新規追加した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2014年 3月 11日 (火) 21:48:02 JST


Revision: 5528
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5528
Author:   yutakapon
Date:     2014-03-11 21:48:02 +0900 (Tue, 11 Mar 2014)
Log Message:
-----------
get_cipher_by_name() を新規追加した。

Modified Paths:
--------------
    branches/ssh_ed25519/ttssh2/ttxssh/ssh.c
    branches/ssh_ed25519/ttssh2/ttxssh/ssh.h

-------------- next part --------------
Modified: branches/ssh_ed25519/ttssh2/ttxssh/ssh.c
===================================================================
--- branches/ssh_ed25519/ttssh2/ttxssh/ssh.c	2014-03-11 12:47:03 UTC (rev 5527)
+++ branches/ssh_ed25519/ttssh2/ttxssh/ssh.c	2014-03-11 12:48:02 UTC (rev 5528)
@@ -4049,6 +4049,26 @@
 	return (val);
 }
 
+// \x88Í\x86\x83A\x83\x8B\x83S\x83\x8A\x83Y\x83\x80\x96\xBC\x82\xA9\x82猟\x8D\x{142DC2}\xE9\x81B
+SSHCipher get_cipher_by_name(char *name)
+{
+	ssh2_cipher_t *ptr = ssh2_ciphers;
+	SSHCipher ret = SSH_CIPHER_NONE;
+
+	if (name == NULL)
+		goto error;
+
+	while (ptr->name != NULL) {
+		if (strcmp(ptr->name, name) == 0) {
+			ret = ptr->cipher;
+			break;
+		}
+		ptr++;
+	}
+error:
+	return (ret);
+}
+
 static char * get_cipher_string(SSHCipher cipher)
 {
 	ssh2_cipher_t *ptr = ssh2_ciphers;

Modified: branches/ssh_ed25519/ttssh2/ttxssh/ssh.h
===================================================================
--- branches/ssh_ed25519/ttssh2/ttxssh/ssh.h	2014-03-11 12:47:03 UTC (rev 5527)
+++ branches/ssh_ed25519/ttssh2/ttxssh/ssh.h	2014-03-11 12:48:02 UTC (rev 5528)
@@ -613,6 +613,7 @@
 void debug_print(int no, char *msg, int len);
 int get_cipher_block_size(SSHCipher cipher);
 int get_cipher_key_len(SSHCipher cipher);
+SSHCipher get_cipher_by_name(char *name);
 char* get_kex_algorithm_name(kex_algorithm kextype);
 const EVP_CIPHER* get_cipher_EVP_CIPHER(SSHCipher cipher);
 const EVP_MD* get_kex_algorithm_EVP_MD(kex_algorithm kextype);



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