X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshdss.c;h=41974c2353be18669bd371b5930d31b58608e1b7;hb=d3b993a9c1d5e66f5432fa73f1435ada191142ca;hp=735001017000a6ad61a7713cd7417265292d5512;hpb=d36a4c3685f17057ba2c80ac471c1284b615469f;p=PuTTY.git diff --git a/sshdss.c b/sshdss.c index 73500101..41974c23 100644 --- a/sshdss.c +++ b/sshdss.c @@ -5,18 +5,6 @@ #include "ssh.h" #include "misc.h" -#define GET_32BIT(cp) \ - (((unsigned long)(unsigned char)(cp)[0] << 24) | \ - ((unsigned long)(unsigned char)(cp)[1] << 16) | \ - ((unsigned long)(unsigned char)(cp)[2] << 8) | \ - ((unsigned long)(unsigned char)(cp)[3])) - -#define PUT_32BIT(cp, value) { \ - (cp)[0] = (unsigned char)((value) >> 24); \ - (cp)[1] = (unsigned char)((value) >> 16); \ - (cp)[2] = (unsigned char)((value) >> 8); \ - (cp)[3] = (unsigned char)(value); } - static void sha_mpint(SHA_State * s, Bignum b) { unsigned char lenbuf[4]; @@ -473,6 +461,18 @@ static int dss_openssh_fmtkey(void *key, unsigned char *blob, int len) return bloblen; } +static int dss_pubkey_bits(void *blob, int len) +{ + struct dss_key *dss; + int ret; + + dss = dss_newkey((char *) blob, len); + ret = bignum_bitcount(dss->p); + dss_freekey(dss); + + return ret; +} + static unsigned char *dss_sign(void *key, char *data, int datalen, int *siglen) { /* @@ -630,6 +630,7 @@ const struct ssh_signkey ssh_dss = { dss_createkey, dss_openssh_createkey, dss_openssh_fmtkey, + dss_pubkey_bits, dss_fingerprint, dss_verifysig, dss_sign,