|
@@ -396,10 +396,9 @@ void ssh_user_close(Ssh *ssh, const char *fmt, ...);
|
|
|
#define SSH_CIPHER_3DES 3
|
|
|
#define SSH_CIPHER_BLOWFISH 6
|
|
|
|
|
|
-typedef struct ssh_keyalg ssh_keyalg;
|
|
|
-typedef struct ssh_key {
|
|
|
- const struct ssh_keyalg *vt;
|
|
|
-} ssh_key;
|
|
|
+struct ssh_key {
|
|
|
+ const ssh_keyalg *vt;
|
|
|
+};
|
|
|
|
|
|
struct RSAKey {
|
|
|
int bits;
|
|
@@ -505,21 +504,19 @@ EdwardsPoint *eddsa_public(mp_int *private_key, const ssh_keyalg *alg);
|
|
|
typedef enum { RSA_SSH1_EXPONENT_FIRST, RSA_SSH1_MODULUS_FIRST } RsaSsh1Order;
|
|
|
|
|
|
void BinarySource_get_rsa_ssh1_pub(
|
|
|
- BinarySource *src, struct RSAKey *result, RsaSsh1Order order);
|
|
|
+ BinarySource *src, RSAKey *result, RsaSsh1Order order);
|
|
|
void BinarySource_get_rsa_ssh1_priv(
|
|
|
- BinarySource *src, struct RSAKey *rsa);
|
|
|
-bool rsa_ssh1_encrypt(unsigned char *data, int length, struct RSAKey *key);
|
|
|
-mp_int *rsa_ssh1_decrypt(mp_int *input, struct RSAKey *key);
|
|
|
-bool rsa_ssh1_decrypt_pkcs1(mp_int *input, struct RSAKey *key,
|
|
|
- strbuf *outbuf);
|
|
|
-char *rsastr_fmt(struct RSAKey *key);
|
|
|
-char *rsa_ssh1_fingerprint(struct RSAKey *key);
|
|
|
-bool rsa_verify(struct RSAKey *key);
|
|
|
-void rsa_ssh1_public_blob(BinarySink *bs, struct RSAKey *key,
|
|
|
- RsaSsh1Order order);
|
|
|
-int rsa_ssh1_public_blob_len(void *data, int maxlen);
|
|
|
-void freersapriv(struct RSAKey *key);
|
|
|
-void freersakey(struct RSAKey *key);
|
|
|
+ BinarySource *src, RSAKey *rsa);
|
|
|
+bool rsa_ssh1_encrypt(unsigned char *data, int length, RSAKey *key);
|
|
|
+mp_int *rsa_ssh1_decrypt(mp_int *input, RSAKey *key);
|
|
|
+bool rsa_ssh1_decrypt_pkcs1(mp_int *input, RSAKey *key, strbuf *outbuf);
|
|
|
+char *rsastr_fmt(RSAKey *key);
|
|
|
+char *rsa_ssh1_fingerprint(RSAKey *key);
|
|
|
+bool rsa_verify(RSAKey *key);
|
|
|
+void rsa_ssh1_public_blob(BinarySink *bs, RSAKey *key, RsaSsh1Order order);
|
|
|
+int rsa_ssh1_public_blob_len(ptrlen data);
|
|
|
+void freersapriv(RSAKey *key);
|
|
|
+void freersakey(RSAKey *key);
|
|
|
#endif // WINSCP_VS
|
|
|
|
|
|
#ifndef WINSCP_VS
|
|
@@ -536,26 +533,22 @@ bool detect_attack(struct crcda_ctx *ctx, unsigned char *buf, uint32_t len,
|
|
|
/*
|
|
|
* SSH2 RSA key exchange functions
|
|
|
*/
|
|
|
-struct ssh_hashalg;
|
|
|
struct ssh_rsa_kex_extra {
|
|
|
int minklen;
|
|
|
};
|
|
|
-struct RSAKey *ssh_rsakex_newkey(const void *data, int len);
|
|
|
-void ssh_rsakex_freekey(struct RSAKey *key);
|
|
|
-int ssh_rsakex_klen(struct RSAKey *key);
|
|
|
-void ssh_rsakex_encrypt(const struct ssh_hashalg *h,
|
|
|
- unsigned char *in, int inlen,
|
|
|
- unsigned char *out, int outlen, struct RSAKey *key);
|
|
|
-mp_int *ssh_rsakex_decrypt(const struct ssh_hashalg *h, ptrlen ciphertext,
|
|
|
- struct RSAKey *rsa);
|
|
|
+RSAKey *ssh_rsakex_newkey(ptrlen data);
|
|
|
+void ssh_rsakex_freekey(RSAKey *key);
|
|
|
+int ssh_rsakex_klen(RSAKey *key);
|
|
|
+strbuf *ssh_rsakex_encrypt(
|
|
|
+ RSAKey *key, const ssh_hashalg *h, ptrlen plaintext);
|
|
|
+mp_int *ssh_rsakex_decrypt(
|
|
|
+ RSAKey *key, const ssh_hashalg *h, ptrlen ciphertext);
|
|
|
|
|
|
/*
|
|
|
* SSH2 ECDH key exchange functions
|
|
|
*/
|
|
|
-struct ssh_kex;
|
|
|
-typedef struct ecdh_key ecdh_key;
|
|
|
-const char *ssh_ecdhkex_curve_textname(const struct ssh_kex *kex);
|
|
|
-ecdh_key *ssh_ecdhkex_newkey(const struct ssh_kex *kex);
|
|
|
+const char *ssh_ecdhkex_curve_textname(const ssh_kex *kex);
|
|
|
+ecdh_key *ssh_ecdhkex_newkey(const ssh_kex *kex);
|
|
|
void ssh_ecdhkex_freekey(ecdh_key *key);
|
|
|
void ssh_ecdhkex_getpublic(ecdh_key *key, BinarySink *bs);
|
|
|
mp_int *ssh_ecdhkex_getkey(ecdh_key *key, ptrlen remoteKey);
|
|
@@ -567,10 +560,9 @@ mp_int *dss_gen_k(const char *id_string,
|
|
|
mp_int *modulus, mp_int *private_key,
|
|
|
unsigned char *digest, int digest_len);
|
|
|
|
|
|
-struct ssh2_cipheralg;
|
|
|
-typedef struct ssh2_cipher {
|
|
|
- const struct ssh2_cipheralg *vt;
|
|
|
-} ssh2_cipher;
|
|
|
+struct ssh2_cipher {
|
|
|
+ const ssh2_cipheralg *vt;
|
|
|
+};
|
|
|
|
|
|
typedef struct {
|
|
|
uint32_t h[4];
|
|
@@ -651,12 +643,9 @@ void SHA384_Init(SHA384_State * s);
|
|
|
void SHA384_Final(SHA384_State * s, unsigned char *output);
|
|
|
void SHA384_Simple(const void *p, int len, unsigned char *output);
|
|
|
|
|
|
-struct ssh2_macalg;
|
|
|
-
|
|
|
-struct ssh1_cipheralg;
|
|
|
-typedef struct ssh1_cipher {
|
|
|
- const struct ssh1_cipheralg *vt;
|
|
|
-} ssh1_cipher;
|
|
|
+struct ssh1_cipher {
|
|
|
+ const ssh1_cipheralg *vt;
|
|
|
+};
|
|
|
|
|
|
struct ssh1_cipheralg {
|
|
|
ssh1_cipher *(*new)(void);
|
|
@@ -675,7 +664,7 @@ struct ssh1_cipheralg {
|
|
|
#define ssh1_cipher_decrypt(ctx, blk, len) ((ctx)->vt->decrypt(ctx, blk, len))
|
|
|
|
|
|
struct ssh2_cipheralg {
|
|
|
- ssh2_cipher *(*new)(const struct ssh2_cipheralg *alg);
|
|
|
+ ssh2_cipher *(*new)(const ssh2_cipheralg *alg);
|
|
|
void (*free)(ssh2_cipher *);
|
|
|
void (*setiv)(ssh2_cipher *, const void *iv);
|
|
|
void (*setkey)(ssh2_cipher *, const void *key);
|
|
@@ -706,7 +695,7 @@ struct ssh2_cipheralg {
|
|
|
#define SSH_CIPHER_SEPARATE_LENGTH 2
|
|
|
const char *text_name;
|
|
|
/* If set, this takes priority over other MAC. */
|
|
|
- const struct ssh2_macalg *required_mac;
|
|
|
+ const ssh2_macalg *required_mac;
|
|
|
};
|
|
|
|
|
|
#define ssh2_cipher_new(alg) ((alg)->new(alg))
|
|
@@ -723,20 +712,19 @@ struct ssh2_cipheralg {
|
|
|
|
|
|
struct ssh2_ciphers {
|
|
|
int nciphers;
|
|
|
- const struct ssh2_cipheralg *const *list;
|
|
|
+ const ssh2_cipheralg *const *list;
|
|
|
};
|
|
|
|
|
|
-struct ssh2_macalg;
|
|
|
-typedef struct ssh2_mac {
|
|
|
- const struct ssh2_macalg *vt;
|
|
|
+struct ssh2_mac {
|
|
|
+ const ssh2_macalg *vt;
|
|
|
BinarySink_DELEGATE_IMPLEMENTATION;
|
|
|
-} ssh2_mac;
|
|
|
+};
|
|
|
|
|
|
struct ssh2_macalg {
|
|
|
/* Passes in the cipher context */
|
|
|
- ssh2_mac *(*new)(const struct ssh2_macalg *alg, ssh2_cipher *cipher);
|
|
|
+ ssh2_mac *(*new)(const ssh2_macalg *alg, ssh2_cipher *cipher);
|
|
|
void (*free)(ssh2_mac *);
|
|
|
- void (*setkey)(ssh2_mac *, const void *key);
|
|
|
+ void (*setkey)(ssh2_mac *, ptrlen key);
|
|
|
void (*start)(ssh2_mac *);
|
|
|
void (*genresult)(ssh2_mac *, unsigned char *);
|
|
|
const char *name, *etm_name;
|
|
@@ -756,19 +744,19 @@ bool ssh2_mac_verresult(ssh2_mac *, const void *);
|
|
|
void ssh2_mac_generate(ssh2_mac *, void *, int, unsigned long seq);
|
|
|
bool ssh2_mac_verify(ssh2_mac *, const void *, int, unsigned long seq);
|
|
|
|
|
|
-typedef struct ssh_hash {
|
|
|
- const struct ssh_hashalg *vt;
|
|
|
+struct ssh_hash {
|
|
|
+ const ssh_hashalg *vt;
|
|
|
BinarySink_DELEGATE_IMPLEMENTATION;
|
|
|
-} ssh_hash;
|
|
|
+};
|
|
|
|
|
|
-typedef struct ssh_hashalg {
|
|
|
- ssh_hash *(*new)(const struct ssh_hashalg *alg);
|
|
|
+struct ssh_hashalg {
|
|
|
+ ssh_hash *(*new)(const ssh_hashalg *alg);
|
|
|
ssh_hash *(*copy)(ssh_hash *);
|
|
|
void (*final)(ssh_hash *, unsigned char *); /* ALSO FREES THE ssh_hash! */
|
|
|
void (*free)(ssh_hash *);
|
|
|
int hlen; /* output length in bytes */
|
|
|
const char *text_name;
|
|
|
-} ssh_hashalg;
|
|
|
+};
|
|
|
|
|
|
#define ssh_hash_new(alg) ((alg)->new(alg))
|
|
|
#define ssh_hash_copy(ctx) ((ctx)->vt->copy(ctx))
|
|
@@ -779,13 +767,13 @@ typedef struct ssh_hashalg {
|
|
|
struct ssh_kex {
|
|
|
const char *name, *groupname;
|
|
|
enum { KEXTYPE_DH, KEXTYPE_RSA, KEXTYPE_ECDH, KEXTYPE_GSS } main_type;
|
|
|
- const struct ssh_hashalg *hash;
|
|
|
+ const ssh_hashalg *hash;
|
|
|
const void *extra; /* private to the kex methods */
|
|
|
};
|
|
|
|
|
|
struct ssh_kexes {
|
|
|
int nkexes;
|
|
|
- const struct ssh_kex *const *list;
|
|
|
+ const ssh_kex *const *list;
|
|
|
};
|
|
|
|
|
|
struct ssh_keyalg {
|
|
@@ -796,8 +784,7 @@ struct ssh_keyalg {
|
|
|
|
|
|
/* Methods that operate on an existing ssh_key */
|
|
|
void (*freekey) (ssh_key *key);
|
|
|
- void (*sign) (ssh_key *key, const void *data, int datalen,
|
|
|
- unsigned flags, BinarySink *);
|
|
|
+ void (*sign) (ssh_key *key, ptrlen data, unsigned flags, BinarySink *);
|
|
|
bool (*verify) (ssh_key *key, ptrlen sig, ptrlen data);
|
|
|
void (*public_blob)(ssh_key *key, BinarySink *);
|
|
|
void (*private_blob)(ssh_key *key, BinarySink *);
|
|
@@ -819,8 +806,8 @@ struct ssh_keyalg {
|
|
|
#define ssh_key_new_priv_openssh(alg, bs) ((alg)->new_priv_openssh(alg, bs))
|
|
|
|
|
|
#define ssh_key_free(key) ((key)->vt->freekey(key))
|
|
|
-#define ssh_key_sign(key, data, len, flags, bs) \
|
|
|
- ((key)->vt->sign(key, data, len, flags, bs))
|
|
|
+#define ssh_key_sign(key, data, flags, bs) \
|
|
|
+ ((key)->vt->sign(key, data, flags, bs))
|
|
|
#define ssh_key_verify(key, sig, data) ((key)->vt->verify(key, sig, data))
|
|
|
#define ssh_key_public_blob(key, bs) ((key)->vt->public_blob(key, bs))
|
|
|
#define ssh_key_private_blob(key, bs) ((key)->vt->private_blob(key, bs))
|
|
@@ -839,12 +826,12 @@ struct ssh_keyalg {
|
|
|
#define SSH_AGENT_RSA_SHA2_256 2
|
|
|
#define SSH_AGENT_RSA_SHA2_512 4
|
|
|
|
|
|
-typedef struct ssh_compressor {
|
|
|
- const struct ssh_compression_alg *vt;
|
|
|
-} ssh_compressor;
|
|
|
-typedef struct ssh_decompressor {
|
|
|
- const struct ssh_compression_alg *vt;
|
|
|
-} ssh_decompressor;
|
|
|
+struct ssh_compressor {
|
|
|
+ const ssh_compression_alg *vt;
|
|
|
+};
|
|
|
+struct ssh_decompressor {
|
|
|
+ const ssh_compression_alg *vt;
|
|
|
+};
|
|
|
|
|
|
struct ssh_compression_alg {
|
|
|
const char *name;
|
|
@@ -882,38 +869,59 @@ struct ssh2_userkey {
|
|
|
/* The maximum length of any hash algorithm. (bytes) */
|
|
|
#define MAX_HASH_LEN (64) /* longest is SHA-512 */
|
|
|
|
|
|
-extern const struct ssh1_cipheralg ssh1_3des;
|
|
|
-extern const struct ssh1_cipheralg ssh1_des;
|
|
|
-extern const struct ssh1_cipheralg ssh1_blowfish;
|
|
|
-extern const struct ssh2_ciphers ssh2_3des;
|
|
|
-extern const struct ssh2_ciphers ssh2_des;
|
|
|
-extern const struct ssh2_ciphers ssh2_aes;
|
|
|
-extern const struct ssh2_ciphers ssh2_blowfish;
|
|
|
-extern const struct ssh2_ciphers ssh2_arcfour;
|
|
|
-extern const struct ssh2_ciphers ssh2_ccp;
|
|
|
-extern const struct ssh_hashalg ssh_sha1;
|
|
|
-extern const struct ssh_hashalg ssh_sha256;
|
|
|
-extern const struct ssh_hashalg ssh_sha384;
|
|
|
-extern const struct ssh_hashalg ssh_sha512;
|
|
|
-extern const struct ssh_kexes ssh_diffiehellman_group1;
|
|
|
-extern const struct ssh_kexes ssh_diffiehellman_group14;
|
|
|
-extern const struct ssh_kexes ssh_diffiehellman_gex;
|
|
|
-extern const struct ssh_kexes ssh_gssk5_sha1_kex;
|
|
|
-extern const struct ssh_kexes ssh_rsa_kex;
|
|
|
-extern const struct ssh_kexes ssh_ecdh_kex;
|
|
|
+extern const ssh1_cipheralg ssh1_3des;
|
|
|
+extern const ssh1_cipheralg ssh1_des;
|
|
|
+extern const ssh1_cipheralg ssh1_blowfish;
|
|
|
+extern const ssh2_cipheralg ssh_3des_ssh2_ctr;
|
|
|
+extern const ssh2_cipheralg ssh_3des_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh_des_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh_des_sshcom_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh_aes256_ctr;
|
|
|
+extern const ssh2_cipheralg ssh_aes256;
|
|
|
+extern const ssh2_cipheralg ssh_aes192_ctr;
|
|
|
+extern const ssh2_cipheralg ssh_aes192;
|
|
|
+extern const ssh2_cipheralg ssh_aes128_ctr;
|
|
|
+extern const ssh2_cipheralg ssh_aes128;
|
|
|
+extern const ssh2_cipheralg ssh_blowfish_ssh2_ctr;
|
|
|
+extern const ssh2_cipheralg ssh_blowfish_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh_arcfour256_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh_arcfour128_ssh2;
|
|
|
+extern const ssh2_cipheralg ssh2_chacha20_poly1305;
|
|
|
+extern const ssh2_ciphers ssh2_3des;
|
|
|
+extern const ssh2_ciphers ssh2_des;
|
|
|
+extern const ssh2_ciphers ssh2_aes;
|
|
|
+extern const ssh2_ciphers ssh2_blowfish;
|
|
|
+extern const ssh2_ciphers ssh2_arcfour;
|
|
|
+extern const ssh2_ciphers ssh2_ccp;
|
|
|
+extern const ssh_hashalg ssh_md5;
|
|
|
+extern const ssh_hashalg ssh_sha1;
|
|
|
+extern const ssh_hashalg ssh_sha256;
|
|
|
+extern const ssh_hashalg ssh_sha384;
|
|
|
+extern const ssh_hashalg ssh_sha512;
|
|
|
+extern const ssh_kexes ssh_diffiehellman_group1;
|
|
|
+extern const ssh_kexes ssh_diffiehellman_group14;
|
|
|
+extern const ssh_kexes ssh_diffiehellman_gex;
|
|
|
+extern const ssh_kexes ssh_gssk5_sha1_kex;
|
|
|
+extern const ssh_kexes ssh_rsa_kex;
|
|
|
+extern const ssh_kex ssh_ec_kex_curve25519;
|
|
|
+extern const ssh_kex ssh_ec_kex_nistp256;
|
|
|
+extern const ssh_kex ssh_ec_kex_nistp384;
|
|
|
+extern const ssh_kex ssh_ec_kex_nistp521;
|
|
|
+extern const ssh_kexes ssh_ecdh_kex;
|
|
|
extern const ssh_keyalg ssh_dss;
|
|
|
extern const ssh_keyalg ssh_rsa;
|
|
|
extern const ssh_keyalg ssh_ecdsa_ed25519;
|
|
|
extern const ssh_keyalg ssh_ecdsa_nistp256;
|
|
|
extern const ssh_keyalg ssh_ecdsa_nistp384;
|
|
|
extern const ssh_keyalg ssh_ecdsa_nistp521;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_md5;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_sha1;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_sha1_buggy;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_sha1_96;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_sha1_96_buggy;
|
|
|
-extern const struct ssh2_macalg ssh_hmac_sha256;
|
|
|
-extern const struct ssh_compression_alg ssh_zlib;
|
|
|
+extern const ssh2_macalg ssh_hmac_md5;
|
|
|
+extern const ssh2_macalg ssh_hmac_sha1;
|
|
|
+extern const ssh2_macalg ssh_hmac_sha1_buggy;
|
|
|
+extern const ssh2_macalg ssh_hmac_sha1_96;
|
|
|
+extern const ssh2_macalg ssh_hmac_sha1_96_buggy;
|
|
|
+extern const ssh2_macalg ssh_hmac_sha256;
|
|
|
+extern const ssh2_macalg ssh2_poly1305;
|
|
|
+extern const ssh_compression_alg ssh_zlib;
|
|
|
|
|
|
typedef struct AESContext AESContext;
|
|
|
AESContext *aes_make_context(void);
|
|
@@ -1078,23 +1086,21 @@ void *x11_dehexify(ptrlen hex, int *outlen);
|
|
|
|
|
|
Channel *agentf_new(SshChannel *c);
|
|
|
|
|
|
-bool dh_is_gex(const struct ssh_kex *kex);
|
|
|
-struct dh_ctx;
|
|
|
-struct dh_ctx *dh_setup_group(const struct ssh_kex *kex);
|
|
|
-struct dh_ctx *dh_setup_gex(mp_int *pval, mp_int *gval);
|
|
|
-int dh_modulus_bit_size(const struct dh_ctx *ctx);
|
|
|
-void dh_cleanup(struct dh_ctx *);
|
|
|
-mp_int *dh_create_e(struct dh_ctx *, int nbits);
|
|
|
-const char *dh_validate_f(struct dh_ctx *, mp_int *f);
|
|
|
-mp_int *dh_find_K(struct dh_ctx *, mp_int *f);
|
|
|
+bool dh_is_gex(const ssh_kex *kex);
|
|
|
+dh_ctx *dh_setup_group(const ssh_kex *kex);
|
|
|
+dh_ctx *dh_setup_gex(mp_int *pval, mp_int *gval);
|
|
|
+int dh_modulus_bit_size(const dh_ctx *ctx);
|
|
|
+void dh_cleanup(dh_ctx *);
|
|
|
+mp_int *dh_create_e(dh_ctx *, int nbits);
|
|
|
+const char *dh_validate_f(dh_ctx *, mp_int *f);
|
|
|
+mp_int *dh_find_K(dh_ctx *, mp_int *f);
|
|
|
|
|
|
bool rsa_ssh1_encrypted(const Filename *filename, char **comment);
|
|
|
int rsa_ssh1_loadpub(const Filename *filename, BinarySink *bs,
|
|
|
char **commentptr, const char **errorstr);
|
|
|
-int rsa_ssh1_loadkey(const Filename *filename, struct RSAKey *key,
|
|
|
+int rsa_ssh1_loadkey(const Filename *filename, RSAKey *key,
|
|
|
const char *passphrase, const char **errorstr);
|
|
|
-bool rsa_ssh1_savekey(const Filename *filename, struct RSAKey *key,
|
|
|
- char *passphrase);
|
|
|
+bool rsa_ssh1_savekey(const Filename *filename, RSAKey *key, char *passphrase);
|
|
|
|
|
|
static inline bool is_base64_char(char c)
|
|
|
{
|
|
@@ -1111,18 +1117,17 @@ extern void base64_encode(FILE *fp, const unsigned char *data, int datalen,
|
|
|
int cpl);
|
|
|
|
|
|
/* ssh2_load_userkey can return this as an error */
|
|
|
-extern struct ssh2_userkey ssh2_wrong_passphrase;
|
|
|
+extern ssh2_userkey ssh2_wrong_passphrase;
|
|
|
#define SSH2_WRONG_PASSPHRASE (&ssh2_wrong_passphrase)
|
|
|
|
|
|
bool ssh2_userkey_encrypted(const Filename *filename, char **comment);
|
|
|
-struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
|
|
- const char *passphrase,
|
|
|
- const char **errorstr);
|
|
|
-bool ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
|
|
- BinarySink *bs,
|
|
|
- char **commentptr, const char **errorstr);
|
|
|
-bool ssh2_save_userkey(const Filename *filename, struct ssh2_userkey *key,
|
|
|
- char *passphrase);
|
|
|
+ssh2_userkey *ssh2_load_userkey(
|
|
|
+ const Filename *filename, const char *passphrase, const char **errorstr);
|
|
|
+bool ssh2_userkey_loadpub(
|
|
|
+ const Filename *filename, char **algorithm, BinarySink *bs,
|
|
|
+ char **commentptr, const char **errorstr);
|
|
|
+bool ssh2_save_userkey(
|
|
|
+ const Filename *filename, ssh2_userkey *key, char *passphrase);
|
|
|
const ssh_keyalg *find_pubkey_alg(const char *name);
|
|
|
const ssh_keyalg *find_pubkey_alg_len(ptrlen name);
|
|
|
|
|
@@ -1169,9 +1174,9 @@ enum {
|
|
|
SSH_KEYTYPE_SSH2_PUBLIC_RFC4716,
|
|
|
SSH_KEYTYPE_SSH2_PUBLIC_OPENSSH
|
|
|
};
|
|
|
-char *ssh1_pubkey_str(struct RSAKey *ssh1key);
|
|
|
-void ssh1_write_pubkey(FILE *fp, struct RSAKey *ssh1key);
|
|
|
-char *ssh2_pubkey_openssh_str(struct ssh2_userkey *key);
|
|
|
+char *ssh1_pubkey_str(RSAKey *ssh1key);
|
|
|
+void ssh1_write_pubkey(FILE *fp, RSAKey *ssh1key);
|
|
|
+char *ssh2_pubkey_openssh_str(ssh2_userkey *key);
|
|
|
void ssh2_write_pubkey(FILE *fp, const char *comment,
|
|
|
const void *v_pub_blob, int pub_len,
|
|
|
int keytype);
|
|
@@ -1187,13 +1192,13 @@ bool import_possible(int type);
|
|
|
int import_target_type(int type);
|
|
|
bool import_encrypted(const Filename *filename, int type, char **comment);
|
|
|
int import_ssh1(const Filename *filename, int type,
|
|
|
- struct RSAKey *key, char *passphrase, const char **errmsg_p);
|
|
|
-struct ssh2_userkey *import_ssh2(const Filename *filename, int type,
|
|
|
- char *passphrase, const char **errmsg_p);
|
|
|
+ RSAKey *key, char *passphrase, const char **errmsg_p);
|
|
|
+ssh2_userkey *import_ssh2(const Filename *filename, int type,
|
|
|
+ char *passphrase, const char **errmsg_p);
|
|
|
bool export_ssh1(const Filename *filename, int type,
|
|
|
- struct RSAKey *key, char *passphrase);
|
|
|
+ RSAKey *key, char *passphrase);
|
|
|
bool export_ssh2(const Filename *filename, int type,
|
|
|
- struct ssh2_userkey *key, char *passphrase);
|
|
|
+ ssh2_userkey *key, char *passphrase);
|
|
|
|
|
|
void des3_decrypt_pubkey(const void *key, void *blk, int len);
|
|
|
void des3_encrypt_pubkey(const void *key, void *blk, int len);
|
|
@@ -1222,7 +1227,7 @@ void openssh_bcrypt(const char *passphrase,
|
|
|
#define PROGFN_PROGRESS 6
|
|
|
typedef void (*progfn_t) (void *param, int action, int phase, int progress);
|
|
|
|
|
|
-int rsa_generate(struct RSAKey *key, int bits, progfn_t pfn,
|
|
|
+int rsa_generate(RSAKey *key, int bits, progfn_t pfn,
|
|
|
void *pfnparam);
|
|
|
int dsa_generate(struct dss_key *key, int bits, progfn_t pfn,
|
|
|
void *pfnparam);
|