1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Pass the ssh_signkey structure itself to public key methods.

Not all of them, but the ones that don't get a 'void *key' parameter.
This means I can share methods between multiple ssh_signkey
structures, and still give those methods an easy way to find out which
public key method they're dealing with, by loading parameters from a
larger structure in which the ssh_signkey is the first element.

(In OO terms, I'm arranging that all static methods of my public key
classes get a pointer to the class vtable, to make up for not having a
pointer to the class instance.)

I haven't actually done anything with the new facility in this commit,
but it will shortly allow me to clean up the constant lookups by curve
name in the ECDSA code.
This commit is contained in:
Simon Tatham
2015-05-15 10:12:07 +01:00
parent a5fc95b715
commit 870ad6ab07
9 changed files with 57 additions and 35 deletions

View File

@ -786,7 +786,8 @@ int main(int argc, char **argv)
if (ssh2blob) {
ssh2algf = find_pubkey_alg(ssh2alg);
if (ssh2algf)
bits = ssh2algf->pubkey_bits(ssh2blob, ssh2bloblen);
bits = ssh2algf->pubkey_bits(ssh2algf,
ssh2blob, ssh2bloblen);
else
bits = -1;
}