svnno****@sourc*****
svnno****@sourc*****
2014年 3月 11日 (火) 21:48:54 JST
Revision: 5529 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5529 Author: yutakapon Date: 2014-03-11 21:48:54 +0900 (Tue, 11 Mar 2014) Log Message: ----------- get_cipher_by_name() を利用して、暗号化アルゴリズム名から検索するようにした。 Modified Paths: -------------- branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c =================================================================== --- branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c 2014-03-11 12:48:02 UTC (rev 5528) +++ branches/ssh_ed25519/ttssh2/ttxssh/ttxssh.c 2014-03-11 12:48:54 UTC (rev 5529) @@ -38,6 +38,7 @@ #include "ssh.h" #include "ttcommon.h" #include "ttlib.h" +#include "keyfiles.h" #include <stdlib.h> #include <stdio.h> @@ -109,15 +110,6 @@ /* WIN32 allows multiple instances of a DLL */ static TInstVar InstVar; -/* openssh private key file format */ -#define MARK_BEGIN "-----BEGIN OPENSSH PRIVATE KEY-----\n" -#define MARK_END "-----END OPENSSH PRIVATE KEY-----\n" -#define KDFNAME "bcrypt" -#define AUTH_MAGIC "openssh-key-v1" -#define SALT_LEN 16 -#define DEFAULT_CIPHERNAME "aes256-cbc" -#define DEFAULT_ROUNDS 16 - /* This code makes lots of assumptions about the order in which Tera Term does things, and how. A key assumption is that the Notification window @@ -4091,7 +4083,7 @@ // based on OpenSSH 6.5:key_save_private(), key_private_to_blob2() static void save_ed25519_private_key(char *passphrase, char *filename, char *comment, HWND dlg, PTInstVar pvar) { - SSHCipher ciphernameval = SSH2_CIPHER_AES256_CBC; + SSHCipher ciphernameval = SSH_CIPHER_NONE; char *ciphername = DEFAULT_CIPHERNAME; int rounds = DEFAULT_ROUNDS; buffer_t *b = NULL; @@ -4115,6 +4107,7 @@ if (b == NULL || kdf == NULL || encoded == NULL || blob == NULL) goto ed25519_error; + ciphernameval = get_cipher_by_name(ciphername); blocksize = get_cipher_block_size(ciphernameval); keylen = get_cipher_key_len(ciphernameval); ivlen = blocksize;