diff options
author | Werner Koch <[email protected]> | 2020-09-11 13:23:22 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-09-11 13:23:22 +0000 |
commit | b6ba6a79ce9336f1b53f16f3d1190dd009fb166e (patch) | |
tree | 00161d710805f2b16ed65184926022c86d868240 /common/util.h | |
parent | keyboxd: Implement lookup by short and long keyid. (diff) | |
download | gnupg-b6ba6a79ce9336f1b53f16f3d1190dd009fb166e.tar.gz gnupg-b6ba6a79ce9336f1b53f16f3d1190dd009fb166e.zip |
common: New function cmp_canon_sexp.
* common/sexputil.c (cmp_canon_sexp): New.
(cmp_canon_sexp_def_tcmp): New.
* common/t-sexputil.c (test_cmp_canon_sexp): Add a simple test.
--
To be used to fix
GnuPG-bug-id: 5061
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h index 490c443d8..f39093566 100644 --- a/common/util.h +++ b/common/util.h @@ -185,6 +185,12 @@ gpg_error_t make_canon_sexp_pad (gcry_sexp_t sexp, int secure, gpg_error_t keygrip_from_canon_sexp (const unsigned char *key, size_t keylen, unsigned char *grip); int cmp_simple_canon_sexp (const unsigned char *a, const unsigned char *b); +int cmp_canon_sexp (const unsigned char *a, size_t alen, + const unsigned char *b, size_t blen, + int (*tcmp)(void *ctx, int depth, + const unsigned char *aval, size_t avallen, + const unsigned char *bval, size_t bvallen), + void *tcmpctx); unsigned char *make_simple_sexp_from_hexstr (const char *line, size_t *nscanned); int hash_algo_from_sigval (const unsigned char *sigval); |