1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-13 17:17:37 -05:00

Improved error messages if you use the wrong key type: you should

now be told that the key is the wrong type, _and_ what type it is,
rather than being given a blanket `unable to read key file' message.

[originally from svn r1662]
This commit is contained in:
Simon Tatham
2002-05-11 12:13:42 +00:00
parent 43ddeb86bf
commit 8c3a0eb50b
5 changed files with 101 additions and 34 deletions

9
ssh.h
View File

@ -297,7 +297,14 @@ char *ssh2_userkey_loadpub(char *filename, char **algorithm,
int ssh2_save_userkey(char *filename, struct ssh2_userkey *key,
char *passphrase);
int keyfile_version(char *filename);
enum {
SSH_KEYTYPE_UNOPENABLE,
SSH_KEYTYPE_UNKNOWN,
SSH_KEYTYPE_SSH1, SSH_KEYTYPE_SSH2,
SSH_KEYTYPE_OPENSSH, SSH_KEYTYPE_SSHCOM
};
int key_type(char *filename);
char *key_type_to_str(int type);
void des3_decrypt_pubkey(unsigned char *key, unsigned char *blk, int len);
void des3_encrypt_pubkey(unsigned char *key, unsigned char *blk, int len);