1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-07 14:25:40 -05:00

Replace more (pointer, length) arg pairs with ptrlen.

The abstract method ssh_key_sign(), and the concrete functions
ssh_rsakex_newkey() and rsa_ssh1_public_blob_len(), now each take a
ptrlen argument in place of a separate pointer and length pair.

Partly that's because I'm generally preferring ptrlens these days and
it keeps argument lists short and tidy-looking, but mostly it's
because it will make those functions easier to wrap in my upcoming
test system.
This commit is contained in:
Simon Tatham
2019-01-01 21:07:48 +00:00
parent febef916a5
commit a2d1c211a7
8 changed files with 27 additions and 29 deletions

View File

@ -416,14 +416,13 @@ mp_int *dss_gen_k(const char *id_string, mp_int *modulus,
return k;
}
static void dss_sign(ssh_key *key, const void *data, int datalen,
unsigned flags, BinarySink *bs)
static void dss_sign(ssh_key *key, ptrlen data, unsigned flags, BinarySink *bs)
{
struct dss_key *dss = container_of(key, struct dss_key, sshk);
unsigned char digest[20];
int i;
SHA_Simple(data, datalen, digest);
SHA_Simple(data.ptr, data.len, digest);
mp_int *k = dss_gen_k("DSA deterministic k generator", dss->q, dss->x,
digest, sizeof(digest));