mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Factor out rsa_ssh1_private_blob_agent and expose in testcrypt.
This will come in useful in an upcoming testcrypt-using Python script.
This commit is contained in:
parent
cbfd7dadac
commit
13e988b6ee
@ -1247,13 +1247,7 @@ int pageant_add_keyfile(Filename *filename, const char *passphrase,
|
|||||||
|
|
||||||
request = strbuf_new_for_agent_query();
|
request = strbuf_new_for_agent_query();
|
||||||
put_byte(request, SSH1_AGENTC_ADD_RSA_IDENTITY);
|
put_byte(request, SSH1_AGENTC_ADD_RSA_IDENTITY);
|
||||||
put_uint32(request, mp_get_nbits(rkey->modulus));
|
rsa_ssh1_private_blob_agent(BinarySink_UPCAST(request), rkey);
|
||||||
put_mp_ssh1(request, rkey->modulus);
|
|
||||||
put_mp_ssh1(request, rkey->exponent);
|
|
||||||
put_mp_ssh1(request, rkey->private_exponent);
|
|
||||||
put_mp_ssh1(request, rkey->iqmp);
|
|
||||||
put_mp_ssh1(request, rkey->q);
|
|
||||||
put_mp_ssh1(request, rkey->p);
|
|
||||||
put_stringz(request, rkey->comment);
|
put_stringz(request, rkey->comment);
|
||||||
agent_query_synchronous(request, &vresponse, &resplen);
|
agent_query_synchronous(request, &vresponse, &resplen);
|
||||||
strbuf_free(request);
|
strbuf_free(request);
|
||||||
|
1
ssh.h
1
ssh.h
@ -551,6 +551,7 @@ char *rsa_ssh1_fingerprint(RSAKey *key);
|
|||||||
bool rsa_verify(RSAKey *key);
|
bool rsa_verify(RSAKey *key);
|
||||||
void rsa_ssh1_public_blob(BinarySink *bs, RSAKey *key, RsaSsh1Order order);
|
void rsa_ssh1_public_blob(BinarySink *bs, RSAKey *key, RsaSsh1Order order);
|
||||||
int rsa_ssh1_public_blob_len(ptrlen data);
|
int rsa_ssh1_public_blob_len(ptrlen data);
|
||||||
|
void rsa_ssh1_private_blob_agent(BinarySink *bs, RSAKey *key);
|
||||||
void freersapriv(RSAKey *key);
|
void freersapriv(RSAKey *key);
|
||||||
void freersakey(RSAKey *key);
|
void freersakey(RSAKey *key);
|
||||||
|
|
||||||
|
9
sshrsa.c
9
sshrsa.c
@ -374,6 +374,15 @@ void rsa_ssh1_public_blob(BinarySink *bs, RSAKey *key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rsa_ssh1_private_blob_agent(BinarySink *bs, RSAKey *key)
|
||||||
|
{
|
||||||
|
rsa_ssh1_public_blob(bs, key, RSA_SSH1_MODULUS_FIRST);
|
||||||
|
put_mp_ssh1(bs, key->private_exponent);
|
||||||
|
put_mp_ssh1(bs, key->iqmp);
|
||||||
|
put_mp_ssh1(bs, key->q);
|
||||||
|
put_mp_ssh1(bs, key->p);
|
||||||
|
}
|
||||||
|
|
||||||
/* Given an SSH-1 public key blob, determine its length. */
|
/* Given an SSH-1 public key blob, determine its length. */
|
||||||
int rsa_ssh1_public_blob_len(ptrlen data)
|
int rsa_ssh1_public_blob_len(ptrlen data)
|
||||||
{
|
{
|
||||||
|
@ -214,6 +214,7 @@ FUNC1(val_string_asciz, rsastr_fmt, val_rsa)
|
|||||||
FUNC1(val_string_asciz, rsa_ssh1_fingerprint, val_rsa)
|
FUNC1(val_string_asciz, rsa_ssh1_fingerprint, val_rsa)
|
||||||
FUNC3(void, rsa_ssh1_public_blob, out_val_string_binarysink, val_rsa, rsaorder)
|
FUNC3(void, rsa_ssh1_public_blob, out_val_string_binarysink, val_rsa, rsaorder)
|
||||||
FUNC1(int, rsa_ssh1_public_blob_len, val_string_ptrlen)
|
FUNC1(int, rsa_ssh1_public_blob_len, val_string_ptrlen)
|
||||||
|
FUNC2(void, rsa_ssh1_private_blob_agent, out_val_string_binarysink, val_rsa)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The PRNG type. Similarly to hashes and MACs, I've invented an extra
|
* The PRNG type. Similarly to hashes and MACs, I've invented an extra
|
||||||
|
Loading…
Reference in New Issue
Block a user