mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
common: New helper functions for OpenPGP curve OIDs.
* common/openpgp-oid.c (openpgp_oidbuf_to_str): Factor most code out
to ...
(openpgp_oidbuf_to_str): new.
(openpgp_oidbuf_is_ed25519): New.
(openpgp_oidbuf_is_cv25519): New.
--
At some places it is more convenient (and faster) to directly work on
buffers and avoid the way via opaque MPIs. These 3 new functions
allow for that.
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 4a1558d0c7
)
This commit is contained in:
parent
9fd6ba268f
commit
dddbb26155
3 changed files with 66 additions and 34 deletions
|
@ -142,7 +142,15 @@ test_openpgp_oid_to_str (void)
|
|||
fail (idx, 0);
|
||||
xfree (string);
|
||||
gcry_mpi_release (a);
|
||||
}
|
||||
|
||||
/* Again using the buffer variant. */
|
||||
string = openpgp_oidbuf_to_str (samples[idx].der, samples[idx].der[0]+1);
|
||||
if (!string)
|
||||
fail (idx, gpg_error_from_syserror ());
|
||||
if (strcmp (string, samples[idx].string))
|
||||
fail (idx, 0);
|
||||
xfree (string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue