Skip to content
Snippets Groups Projects
Commit 42721f77 authored by Niels Möller's avatar Niels Möller
Browse files

(dsa_signature_from_sexp): New function.

Rev: src/nettle/dsa.h:1.6
Rev: src/nettle/sexp2dsa.c:1.3
parent d41a05cb
Branches
Tags
No related merge requests found
...@@ -153,6 +153,10 @@ dsa_generate_keypair(struct dsa_public_key *pub, ...@@ -153,6 +153,10 @@ dsa_generate_keypair(struct dsa_public_key *pub,
struct sexp_iterator; struct sexp_iterator;
int
dsa_signature_from_sexp(struct dsa_signature *rs,
struct sexp_iterator *i);
int int
dsa_keypair_from_sexp_alist(struct dsa_public_key *pub, dsa_keypair_from_sexp_alist(struct dsa_public_key *pub,
struct dsa_private_key *priv, struct dsa_private_key *priv,
......
...@@ -87,4 +87,20 @@ dsa_keypair_from_sexp(struct dsa_public_key *pub, ...@@ -87,4 +87,20 @@ dsa_keypair_from_sexp(struct dsa_public_key *pub,
&& dsa_keypair_from_sexp_alist(pub, priv, limit, &i); && dsa_keypair_from_sexp_alist(pub, priv, limit, &i);
} }
int
dsa_signature_from_sexp(struct dsa_signature *rs,
struct sexp_iterator *i)
{
static const uint8_t *names[2] = { "r", "s" };
struct sexp_iterator values[2];
if (!sexp_iterator_assoc(i, 2, names, values))
return 0;
GET(rs->r, 160, &values[0]);
GET(rs->s, 160, &values[1]);
return 1;
}
#endif /* WITH_PUBLIC_KEY */ #endif /* WITH_PUBLIC_KEY */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment