1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-08 08:58:00 +00:00

Spelling: standardise on "DSA", not "DSS".

This code base has always been a bit confused about which spelling it
likes to use to refer to that signature algorithm. The SSH protocol id
is "ssh-dss". But everyone I know refers to it as the Digital
Signature _Algorithm_, not the Digital Signature _Standard_.

When I moved everything down into the crypto subdir, I took the
opportunity to rename sshdss.c to dsa.c. Now I'm doing the rest of the
job: all internal identifiers and code comments refer to DSA, and the
spelling "dss" only survives in externally visible identifiers that
have to remain constant.

(Such identifiers include the SSH protocol id, and also the string id
used to identify the key type in PuTTY's own host key cache. We can't
change the latter without causing everyone a backwards-compatibility
headache, and if we _did_ ever decide to do that, we'd surely want to
do a much more thorough job of making the cache format more sensible!)
This commit is contained in:
Simon Tatham 2021-04-22 18:28:35 +01:00
parent 419e5e2230
commit 1c039d0a7b
12 changed files with 157 additions and 157 deletions

View File

@ -878,10 +878,10 @@ int main(int argc, char **argv)
PrimeGenerationContext *pgc = primegen_new_context(primegen);
if (keytype == DSA) {
struct dss_key *dsskey = snew(struct dss_key);
dsa_generate(dsskey, bits, pgc, &cmdgen_progress);
struct dsa_key *dsakey = snew(struct dsa_key);
dsa_generate(dsakey, bits, pgc, &cmdgen_progress);
ssh2key = snew(ssh2_userkey);
ssh2key->key = &dsskey->sshk;
ssh2key->key = &dsakey->sshk;
ssh1key = NULL;
} else if (keytype == ECDSA) {
struct ecdsa_key *ek = snew(struct ecdsa_key);

View File

@ -10,49 +10,49 @@
#include "mpint.h"
#include "misc.h"
static void dss_freekey(ssh_key *key); /* forward reference */
static void dsa_freekey(ssh_key *key); /* forward reference */
static ssh_key *dss_new_pub(const ssh_keyalg *self, ptrlen data)
static ssh_key *dsa_new_pub(const ssh_keyalg *self, ptrlen data)
{
BinarySource src[1];
struct dss_key *dss;
struct dsa_key *dsa;
BinarySource_BARE_INIT_PL(src, data);
if (!ptrlen_eq_string(get_string(src), "ssh-dss"))
return NULL;
dss = snew(struct dss_key);
dss->sshk.vt = &ssh_dss;
dss->p = get_mp_ssh2(src);
dss->q = get_mp_ssh2(src);
dss->g = get_mp_ssh2(src);
dss->y = get_mp_ssh2(src);
dss->x = NULL;
dsa = snew(struct dsa_key);
dsa->sshk.vt = &ssh_dsa;
dsa->p = get_mp_ssh2(src);
dsa->q = get_mp_ssh2(src);
dsa->g = get_mp_ssh2(src);
dsa->y = get_mp_ssh2(src);
dsa->x = NULL;
if (get_err(src) ||
mp_eq_integer(dss->p, 0) || mp_eq_integer(dss->q, 0)) {
mp_eq_integer(dsa->p, 0) || mp_eq_integer(dsa->q, 0)) {
/* Invalid key. */
dss_freekey(&dss->sshk);
dsa_freekey(&dsa->sshk);
return NULL;
}
return &dss->sshk;
return &dsa->sshk;
}
static void dss_freekey(ssh_key *key)
static void dsa_freekey(ssh_key *key)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
if (dss->p)
mp_free(dss->p);
if (dss->q)
mp_free(dss->q);
if (dss->g)
mp_free(dss->g);
if (dss->y)
mp_free(dss->y);
if (dss->x)
mp_free(dss->x);
sfree(dss);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
if (dsa->p)
mp_free(dsa->p);
if (dsa->q)
mp_free(dsa->q);
if (dsa->g)
mp_free(dsa->g);
if (dsa->y)
mp_free(dsa->y);
if (dsa->x)
mp_free(dsa->x);
sfree(dsa);
}
static void append_hex_to_strbuf(strbuf *sb, mp_int *x)
@ -67,55 +67,55 @@ static void append_hex_to_strbuf(strbuf *sb, mp_int *x)
sfree(hex);
}
static char *dss_cache_str(ssh_key *key)
static char *dsa_cache_str(ssh_key *key)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
strbuf *sb = strbuf_new();
if (!dss->p) {
if (!dsa->p) {
strbuf_free(sb);
return NULL;
}
append_hex_to_strbuf(sb, dss->p);
append_hex_to_strbuf(sb, dss->q);
append_hex_to_strbuf(sb, dss->g);
append_hex_to_strbuf(sb, dss->y);
append_hex_to_strbuf(sb, dsa->p);
append_hex_to_strbuf(sb, dsa->q);
append_hex_to_strbuf(sb, dsa->g);
append_hex_to_strbuf(sb, dsa->y);
return strbuf_to_str(sb);
}
static key_components *dss_components(ssh_key *key)
static key_components *dsa_components(ssh_key *key)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
key_components *kc = key_components_new();
key_components_add_text(kc, "key_type", "DSA");
assert(dss->p);
key_components_add_mp(kc, "p", dss->p);
key_components_add_mp(kc, "q", dss->q);
key_components_add_mp(kc, "g", dss->g);
key_components_add_mp(kc, "public_y", dss->y);
if (dss->x)
key_components_add_mp(kc, "private_x", dss->x);
assert(dsa->p);
key_components_add_mp(kc, "p", dsa->p);
key_components_add_mp(kc, "q", dsa->q);
key_components_add_mp(kc, "g", dsa->g);
key_components_add_mp(kc, "public_y", dsa->y);
if (dsa->x)
key_components_add_mp(kc, "private_x", dsa->x);
return kc;
}
static char *dss_invalid(ssh_key *key, unsigned flags)
static char *dsa_invalid(ssh_key *key, unsigned flags)
{
/* No validity criterion will stop us from using a DSA key at all */
return NULL;
}
static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data)
static bool dsa_verify(ssh_key *key, ptrlen sig, ptrlen data)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
BinarySource src[1];
unsigned char hash[20];
bool toret;
if (!dss->p)
if (!dsa->p)
return false;
BinarySource_BARE_INIT_PL(src, sig);
@ -155,8 +155,8 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data)
unsigned invalid = 0;
invalid |= mp_eq_integer(r, 0);
invalid |= mp_eq_integer(s, 0);
invalid |= mp_cmp_hs(r, dss->q);
invalid |= mp_cmp_hs(s, dss->q);
invalid |= mp_cmp_hs(r, dsa->q);
invalid |= mp_cmp_hs(s, dsa->q);
if (invalid) {
mp_free(r);
mp_free(s);
@ -166,7 +166,7 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data)
/*
* Step 1. w <- s^-1 mod q.
*/
mp_int *w = mp_invert(s, dss->q);
mp_int *w = mp_invert(s, dsa->q);
if (!w) {
mp_free(r);
mp_free(s);
@ -178,20 +178,20 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data)
*/
hash_simple(&ssh_sha1, data, hash);
mp_int *sha = mp_from_bytes_be(make_ptrlen(hash, 20));
mp_int *u1 = mp_modmul(sha, w, dss->q);
mp_int *u1 = mp_modmul(sha, w, dsa->q);
/*
* Step 3. u2 <- r * w mod q.
*/
mp_int *u2 = mp_modmul(r, w, dss->q);
mp_int *u2 = mp_modmul(r, w, dsa->q);
/*
* Step 4. v <- (g^u1 * y^u2 mod p) mod q.
*/
mp_int *gu1p = mp_modpow(dss->g, u1, dss->p);
mp_int *yu2p = mp_modpow(dss->y, u2, dss->p);
mp_int *gu1yu2p = mp_modmul(gu1p, yu2p, dss->p);
mp_int *v = mp_mod(gu1yu2p, dss->q);
mp_int *gu1p = mp_modpow(dsa->g, u1, dsa->p);
mp_int *yu2p = mp_modpow(dsa->y, u2, dsa->p);
mp_int *gu1yu2p = mp_modmul(gu1p, yu2p, dsa->p);
mp_int *v = mp_mod(gu1yu2p, dsa->q);
/*
* Step 5. v should now be equal to r.
@ -213,57 +213,57 @@ static bool dss_verify(ssh_key *key, ptrlen sig, ptrlen data)
return toret;
}
static void dss_public_blob(ssh_key *key, BinarySink *bs)
static void dsa_public_blob(ssh_key *key, BinarySink *bs)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
put_stringz(bs, "ssh-dss");
put_mp_ssh2(bs, dss->p);
put_mp_ssh2(bs, dss->q);
put_mp_ssh2(bs, dss->g);
put_mp_ssh2(bs, dss->y);
put_mp_ssh2(bs, dsa->p);
put_mp_ssh2(bs, dsa->q);
put_mp_ssh2(bs, dsa->g);
put_mp_ssh2(bs, dsa->y);
}
static void dss_private_blob(ssh_key *key, BinarySink *bs)
static void dsa_private_blob(ssh_key *key, BinarySink *bs)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
put_mp_ssh2(bs, dss->x);
put_mp_ssh2(bs, dsa->x);
}
static ssh_key *dss_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv)
static ssh_key *dsa_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv)
{
BinarySource src[1];
ssh_key *sshk;
struct dss_key *dss;
struct dsa_key *dsa;
ptrlen hash;
unsigned char digest[20];
mp_int *ytest;
sshk = dss_new_pub(self, pub);
sshk = dsa_new_pub(self, pub);
if (!sshk)
return NULL;
dss = container_of(sshk, struct dss_key, sshk);
dsa = container_of(sshk, struct dsa_key, sshk);
BinarySource_BARE_INIT_PL(src, priv);
dss->x = get_mp_ssh2(src);
dsa->x = get_mp_ssh2(src);
if (get_err(src)) {
dss_freekey(&dss->sshk);
dsa_freekey(&dsa->sshk);
return NULL;
}
/*
* Check the obsolete hash in the old DSS key format.
* Check the obsolete hash in the old DSA key format.
*/
hash = get_string(src);
if (hash.len == 20) {
ssh_hash *h = ssh_hash_new(&ssh_sha1);
put_mp_ssh2(h, dss->p);
put_mp_ssh2(h, dss->q);
put_mp_ssh2(h, dss->g);
put_mp_ssh2(h, dsa->p);
put_mp_ssh2(h, dsa->q);
put_mp_ssh2(h, dsa->g);
ssh_hash_final(h, digest);
if (!smemeq(hash.ptr, digest, 20)) {
dss_freekey(&dss->sshk);
dsa_freekey(&dsa->sshk);
return NULL;
}
}
@ -271,75 +271,75 @@ static ssh_key *dss_new_priv(const ssh_keyalg *self, ptrlen pub, ptrlen priv)
/*
* Now ensure g^x mod p really is y.
*/
ytest = mp_modpow(dss->g, dss->x, dss->p);
if (!mp_cmp_eq(ytest, dss->y)) {
ytest = mp_modpow(dsa->g, dsa->x, dsa->p);
if (!mp_cmp_eq(ytest, dsa->y)) {
mp_free(ytest);
dss_freekey(&dss->sshk);
dsa_freekey(&dsa->sshk);
return NULL;
}
mp_free(ytest);
return &dss->sshk;
return &dsa->sshk;
}
static ssh_key *dss_new_priv_openssh(const ssh_keyalg *self,
static ssh_key *dsa_new_priv_openssh(const ssh_keyalg *self,
BinarySource *src)
{
struct dss_key *dss;
struct dsa_key *dsa;
dss = snew(struct dss_key);
dss->sshk.vt = &ssh_dss;
dsa = snew(struct dsa_key);
dsa->sshk.vt = &ssh_dsa;
dss->p = get_mp_ssh2(src);
dss->q = get_mp_ssh2(src);
dss->g = get_mp_ssh2(src);
dss->y = get_mp_ssh2(src);
dss->x = get_mp_ssh2(src);
dsa->p = get_mp_ssh2(src);
dsa->q = get_mp_ssh2(src);
dsa->g = get_mp_ssh2(src);
dsa->y = get_mp_ssh2(src);
dsa->x = get_mp_ssh2(src);
if (get_err(src) ||
mp_eq_integer(dss->q, 0) || mp_eq_integer(dss->p, 0)) {
mp_eq_integer(dsa->q, 0) || mp_eq_integer(dsa->p, 0)) {
/* Invalid key. */
dss_freekey(&dss->sshk);
dsa_freekey(&dsa->sshk);
return NULL;
}
return &dss->sshk;
return &dsa->sshk;
}
static void dss_openssh_blob(ssh_key *key, BinarySink *bs)
static void dsa_openssh_blob(ssh_key *key, BinarySink *bs)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
put_mp_ssh2(bs, dss->p);
put_mp_ssh2(bs, dss->q);
put_mp_ssh2(bs, dss->g);
put_mp_ssh2(bs, dss->y);
put_mp_ssh2(bs, dss->x);
put_mp_ssh2(bs, dsa->p);
put_mp_ssh2(bs, dsa->q);
put_mp_ssh2(bs, dsa->g);
put_mp_ssh2(bs, dsa->y);
put_mp_ssh2(bs, dsa->x);
}
static int dss_pubkey_bits(const ssh_keyalg *self, ptrlen pub)
static int dsa_pubkey_bits(const ssh_keyalg *self, ptrlen pub)
{
ssh_key *sshk;
struct dss_key *dss;
struct dsa_key *dsa;
int ret;
sshk = dss_new_pub(self, pub);
sshk = dsa_new_pub(self, pub);
if (!sshk)
return -1;
dss = container_of(sshk, struct dss_key, sshk);
ret = mp_get_nbits(dss->p);
dss_freekey(&dss->sshk);
dsa = container_of(sshk, struct dsa_key, sshk);
ret = mp_get_nbits(dsa->p);
dsa_freekey(&dsa->sshk);
return ret;
}
mp_int *dss_gen_k(const char *id_string, mp_int *modulus,
mp_int *dsa_gen_k(const char *id_string, mp_int *modulus,
mp_int *private_key,
unsigned char *digest, int digest_len)
{
/*
* The basic DSS signing algorithm is:
* The basic DSA signing algorithm is:
*
* - invent a random k between 1 and q-1 (exclusive).
* - Compute r = (g^k mod p) mod q.
@ -445,29 +445,29 @@ mp_int *dss_gen_k(const char *id_string, mp_int *modulus,
return k;
}
static void dss_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs)
static void dsa_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
struct dsa_key *dsa = container_of(key, struct dsa_key, sshk);
unsigned char digest[20];
int i;
hash_simple(&ssh_sha1, data, digest);
mp_int *k = dss_gen_k("DSA deterministic k generator", dss->q, dss->x,
mp_int *k = dsa_gen_k("DSA deterministic k generator", dsa->q, dsa->x,
digest, sizeof(digest));
mp_int *kinv = mp_invert(k, dss->q); /* k^-1 mod q */
mp_int *kinv = mp_invert(k, dsa->q); /* k^-1 mod q */
/*
* Now we have k, so just go ahead and compute the signature.
*/
mp_int *gkp = mp_modpow(dss->g, k, dss->p); /* g^k mod p */
mp_int *r = mp_mod(gkp, dss->q); /* r = (g^k mod p) mod q */
mp_int *gkp = mp_modpow(dsa->g, k, dsa->p); /* g^k mod p */
mp_int *r = mp_mod(gkp, dsa->q); /* r = (g^k mod p) mod q */
mp_free(gkp);
mp_int *hash = mp_from_bytes_be(make_ptrlen(digest, 20));
mp_int *xr = mp_mul(dss->x, r);
mp_int *xr = mp_mul(dsa->x, r);
mp_int *hxr = mp_add(xr, hash); /* hash + x*r */
mp_int *s = mp_modmul(kinv, hxr, dss->q); /* s = k^-1 * (hash+x*r) mod q */
mp_int *s = mp_modmul(kinv, hxr, dsa->q); /* s = k^-1 * (hash+x*r) mod q */
mp_free(hxr);
mp_free(xr);
mp_free(kinv);
@ -484,20 +484,20 @@ static void dss_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs)
mp_free(s);
}
const ssh_keyalg ssh_dss = {
.new_pub = dss_new_pub,
.new_priv = dss_new_priv,
.new_priv_openssh = dss_new_priv_openssh,
.freekey = dss_freekey,
.invalid = dss_invalid,
.sign = dss_sign,
.verify = dss_verify,
.public_blob = dss_public_blob,
.private_blob = dss_private_blob,
.openssh_blob = dss_openssh_blob,
.cache_str = dss_cache_str,
.components = dss_components,
.pubkey_bits = dss_pubkey_bits,
const ssh_keyalg ssh_dsa = {
.new_pub = dsa_new_pub,
.new_priv = dsa_new_priv,
.new_priv_openssh = dsa_new_priv_openssh,
.freekey = dsa_freekey,
.invalid = dsa_invalid,
.sign = dsa_sign,
.verify = dsa_verify,
.public_blob = dsa_public_blob,
.private_blob = dsa_private_blob,
.openssh_blob = dsa_openssh_blob,
.cache_str = dsa_cache_str,
.components = dsa_components,
.pubkey_bits = dsa_pubkey_bits,
.ssh_id = "ssh-dss",
.cache_id = "dss",
};

View File

@ -1117,7 +1117,7 @@ static void ecdsa_sign(ssh_key *key, ptrlen data,
{
unsigned char digest[20];
hash_simple(&ssh_sha1, data, digest);
k = dss_gen_k(
k = dsa_gen_k(
"ECDSA deterministic k generator", ek->curve->w.G_order,
ek->privateKey, digest, sizeof(digest));
}

View File

@ -775,7 +775,7 @@ static ssh2_userkey *openssh_pem_read(
*/
assert(privptr > 0); /* should have bombed by now if not */
retkey = snew(ssh2_userkey);
alg = (key->keytype == OP_RSA ? &ssh_rsa : &ssh_dss);
alg = (key->keytype == OP_RSA ? &ssh_rsa : &ssh_dsa);
retkey->key = ssh_key_new_priv(
alg, make_ptrlen(blob->u, privptr),
make_ptrlen(blob->u+privptr, blob->len-privptr));
@ -841,11 +841,11 @@ static bool openssh_pem_write(
* line.
*/
if (ssh_key_alg(key->key) == &ssh_rsa ||
ssh_key_alg(key->key) == &ssh_dss) {
ssh_key_alg(key->key) == &ssh_dsa) {
strbuf *seq;
/*
* The RSA and DSS handlers share some code because the two
* The RSA and DSA handlers share some code because the two
* key types have very similar ASN.1 representations, as a
* plain SEQUENCE of big integers. So we set up a list of
* bignums per key type and then construct the actual blob in
@ -1634,7 +1634,7 @@ static bool openssh_auto_write(
* assume that anything not in that fixed list is newer, and hence
* will use the new format.
*/
if (ssh_key_alg(key->key) == &ssh_dss ||
if (ssh_key_alg(key->key) == &ssh_dsa ||
ssh_key_alg(key->key) == &ssh_rsa ||
ssh_key_alg(key->key) == &ssh_ecdsa_nistp256 ||
ssh_key_alg(key->key) == &ssh_ecdsa_nistp384 ||
@ -2111,7 +2111,7 @@ static ssh2_userkey *sshcom_read(
goto error;
}
alg = &ssh_dss;
alg = &ssh_dsa;
put_stringz(blob, "ssh-dss");
put_mp_ssh2_from_string(blob, p);
put_mp_ssh2_from_string(blob, q);
@ -2202,7 +2202,7 @@ static bool sshcom_write(
nnumbers = 6;
initial_zero = false;
type = "if-modn{sign{rsa-pkcs1-sha1},encrypt{rsa-pkcs1v2-oaep}}";
} else if (ssh_key_alg(key->key) == &ssh_dss) {
} else if (ssh_key_alg(key->key) == &ssh_dsa) {
ptrlen p, q, g, y, x;
/*

View File

@ -1,5 +1,5 @@
/*
* DSS key generation.
* DSA key generation.
*/
#include "misc.h"
@ -7,7 +7,7 @@
#include "sshkeygen.h"
#include "mpint.h"
int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc,
int dsa_generate(struct dsa_key *key, int bits, PrimeGenerationContext *pgc,
ProgressReceiver *prog)
{
/*
@ -91,7 +91,7 @@ int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc,
mp_free(two);
mp_free(qm1);
key->sshk.vt = &ssh_dss;
key->sshk.vt = &ssh_dsa;
key->p = p;
key->q = q;

6
ssh.h
View File

@ -446,7 +446,7 @@ struct RSAKey {
ssh_key sshk;
};
struct dss_key {
struct dsa_key {
mp_int *p, *q, *g, *y, *x;
ssh_key sshk;
};
@ -614,7 +614,7 @@ mp_int *ssh_ecdhkex_getkey(ecdh_key *key, ptrlen remoteKey);
/*
* Helper function for k generation in DSA, reused in ECDSA
*/
mp_int *dss_gen_k(const char *id_string,
mp_int *dsa_gen_k(const char *id_string,
mp_int *modulus, mp_int *private_key,
unsigned char *digest, int digest_len);
@ -1019,7 +1019,7 @@ 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_dsa;
extern const ssh_keyalg ssh_rsa;
extern const ssh_keyalg ssh_rsa_sha256;
extern const ssh_keyalg ssh_rsa_sha512;

View File

@ -52,7 +52,7 @@ struct kexinit_algorithm {
X(HK_ECDSA, ssh_ecdsa_nistp256) \
X(HK_ECDSA, ssh_ecdsa_nistp384) \
X(HK_ECDSA, ssh_ecdsa_nistp521) \
X(HK_DSA, ssh_dss) \
X(HK_DSA, ssh_dsa) \
X(HK_RSA, ssh_rsa_sha512) \
X(HK_RSA, ssh_rsa_sha256) \
X(HK_RSA, ssh_rsa) \

View File

@ -286,7 +286,7 @@ extern const PrimeGenerationPolicy primegen_provable_maurer_complex;
int rsa_generate(RSAKey *key, int bits, bool strong,
PrimeGenerationContext *pgc, ProgressReceiver *prog);
int dsa_generate(struct dss_key *key, int bits, PrimeGenerationContext *pgc,
int dsa_generate(struct dsa_key *key, int bits, PrimeGenerationContext *pgc,
ProgressReceiver *prog);
int ecdsa_generate(struct ecdsa_key *key, int bits);
int eddsa_generate(struct eddsa_key *key, int bits);

View File

@ -563,7 +563,7 @@ const ssh_keyalg *const all_keyalgs[] = {
&ssh_rsa,
&ssh_rsa_sha256,
&ssh_rsa_sha512,
&ssh_dss,
&ssh_dsa,
&ssh_ecdsa_nistp256,
&ssh_ecdsa_nistp384,
&ssh_ecdsa_nistp521,

View File

@ -270,7 +270,7 @@ static const ssh_keyalg *get_keyalg(BinarySource *in)
const char *key;
const ssh_keyalg *value;
} algs[] = {
{"dsa", &ssh_dss},
{"dsa", &ssh_dsa},
{"rsa", &ssh_rsa},
{"ed25519", &ssh_ecdsa_ed25519},
{"ed448", &ssh_ecdsa_ed448},
@ -1239,9 +1239,9 @@ ssh_key *rsa_generate_wrapper(int bits, bool strong,
ssh_key *dsa_generate_wrapper(int bits, PrimeGenerationContext *pgc)
{
struct dss_key *dsskey = snew(struct dss_key);
dsa_generate(dsskey, bits, pgc, &null_progress);
return &dsskey->sshk;
struct dsa_key *dsakey = snew(struct dsa_key);
dsa_generate(dsakey, bits, pgc, &null_progress);
return &dsakey->sshk;
}
#define dsa_generate dsa_generate_wrapper

View File

@ -593,7 +593,7 @@ struct rsa_key_thread_params {
bool rsa_strong;
union {
RSAKey *key;
struct dss_key *dsskey;
struct dsa_key *dsakey;
struct ecdsa_key *eckey;
struct eddsa_key *edkey;
};
@ -610,7 +610,7 @@ static DWORD WINAPI generate_key_thread(void *param)
PrimeGenerationContext *pgc = primegen_new_context(params->primepolicy);
if (params->keytype == DSA)
dsa_generate(params->dsskey, params->key_bits, pgc, &prog.rec);
dsa_generate(params->dsakey, params->key_bits, pgc, &prog.rec);
else if (params->keytype == ECDSA)
ecdsa_generate(params->eckey, params->curve_bits);
else if (params->keytype == EDDSA)
@ -645,7 +645,7 @@ struct MainDlgState {
unsigned *entropy;
union {
RSAKey key;
struct dss_key dsskey;
struct dsa_key dsakey;
struct ecdsa_key eckey;
struct eddsa_key edkey;
};
@ -1158,7 +1158,7 @@ static void start_generating_key(HWND hwnd, struct MainDlgState *state)
params->primepolicy = state->primepolicy;
params->rsa_strong = state->rsa_strong;
params->key = &state->key;
params->dsskey = &state->dsskey;
params->dsakey = &state->dsakey;
if (!CreateThread(NULL, 0, generate_key_thread,
params, 0, &threadid)) {
@ -1828,7 +1828,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETPOS, PROGRESSRANGE, 0);
if (state->ssh2) {
if (state->keytype == DSA) {
state->ssh2key.key = &state->dsskey.sshk;
state->ssh2key.key = &state->dsakey.sshk;
} else if (state->keytype == ECDSA) {
state->ssh2key.key = &state->eckey.sshk;
} else if (state->keytype == EDDSA) {

View File

@ -366,7 +366,7 @@ static void keylist_update_callback(
ptrlen algname = get_string(src);
const ssh_keyalg *alg = find_pubkey_alg_len(algname);
bool include_bit_count = (alg == &ssh_dss && alg == &ssh_rsa);
bool include_bit_count = (alg == &ssh_dsa && alg == &ssh_rsa);
int wordnumber = 0;
for (const char *p = fingerprint; *p; p++) {