mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
Rewrite SSH key loading and saving using marshal.h.
All the functions that read and write public and private keys to a FILE * are now small wrappers on top of an underlying set of functions that read data in the same format from a BinarySource, or write it to a strbuf. This sets me up to deal with key files in contexts other than on disk.
This commit is contained in:
parent
ef843e9638
commit
9cc586e605
18
ssh.h
18
ssh.h
@ -1165,19 +1165,33 @@ extern void base64_encode(FILE *fp, const unsigned char *data, int datalen,
|
||||
extern ssh2_userkey ssh2_wrong_passphrase;
|
||||
#define SSH2_WRONG_PASSPHRASE (&ssh2_wrong_passphrase)
|
||||
|
||||
bool ppk_encrypted_s(BinarySource *src, char **comment);
|
||||
bool ppk_encrypted_f(const Filename *filename, char **comment);
|
||||
bool rsa1_encrypted_s(BinarySource *src, char **comment);
|
||||
bool rsa1_encrypted_f(const Filename *filename, char **comment);
|
||||
|
||||
ssh2_userkey *ppk_load_s(BinarySource *src, const char *passphrase,
|
||||
const char **errorstr);
|
||||
ssh2_userkey *ppk_load_f(const Filename *filename, const char *passphrase,
|
||||
const char **errorstr);
|
||||
int rsa1_load_s(BinarySource *src, RSAKey *key,
|
||||
const char *passphrase, const char **errorstr);
|
||||
int rsa1_load_f(const Filename *filename, RSAKey *key,
|
||||
const char *passphrase, const char **errorstr);
|
||||
|
||||
bool ppk_save_f(const Filename *filename, ssh2_userkey *key, char *passphrase);
|
||||
bool rsa1_save_f(const Filename *filename, RSAKey *key, char *passphrase);
|
||||
strbuf *ppk_save_sb(ssh2_userkey *key, const char *passphrase);
|
||||
bool ppk_save_f(const Filename *filename, ssh2_userkey *key,
|
||||
const char *passphrase);
|
||||
strbuf *rsa1_save_sb(RSAKey *key, const char *passphrase);
|
||||
bool rsa1_save_f(const Filename *filename, RSAKey *key,
|
||||
const char *passphrase);
|
||||
|
||||
bool ppk_loadpub_s(BinarySource *src, char **algorithm, BinarySink *bs,
|
||||
char **commentptr, const char **errorstr);
|
||||
bool ppk_loadpub_f(const Filename *filename, char **algorithm, BinarySink *bs,
|
||||
char **commentptr, const char **errorstr);
|
||||
int rsa1_loadpub_s(BinarySource *src, BinarySink *bs,
|
||||
char **commentptr, const char **errorstr);
|
||||
int rsa1_loadpub_f(const Filename *filename, BinarySink *bs,
|
||||
char **commentptr, const char **errorstr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user