1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpgsm: Replace all assert calls by log_assert.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-07-08 14:40:34 +02:00
parent a6a4bbf6de
commit 9ee975d588
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
19 changed files with 29 additions and 44 deletions

View file

@ -24,7 +24,6 @@
#include <errno.h>
#include <unistd.h>
#include <time.h>
#include <assert.h>
#include "gpgsm.h"
@ -55,7 +54,7 @@ gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
algo = GCRY_MD_SHA1;
len = gcry_md_get_algo_dlen (algo);
assert (len);
log_assert (len);
if (!array)
array = xmalloc (len);
@ -67,7 +66,7 @@ gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
{
size_t buflen;
assert (len >= 20);
log_assert (len >= 20);
if (!ksba_cert_get_user_data (cert, "sha1-fingerprint",
array, len, &buflen)
&& buflen == 20)
@ -115,7 +114,7 @@ gpgsm_get_fingerprint_string (ksba_cert_t cert, int algo)
algo = GCRY_MD_SHA1;
len = gcry_md_get_algo_dlen (algo);
assert (len <= MAX_DIGEST_LEN );
log_assert (len <= MAX_DIGEST_LEN );
gpgsm_get_fingerprint (cert, algo, digest, NULL);
buf = xmalloc (len*3+1);
bin2hexcolon (digest, len, buf);
@ -135,7 +134,7 @@ gpgsm_get_fingerprint_hexstring (ksba_cert_t cert, int algo)
algo = GCRY_MD_SHA1;
len = gcry_md_get_algo_dlen (algo);
assert (len <= MAX_DIGEST_LEN );
log_assert (len <= MAX_DIGEST_LEN );
gpgsm_get_fingerprint (cert, algo, digest, NULL);
buf = xmalloc (len*2+1);
bin2hex (digest, len, buf);
@ -307,8 +306,8 @@ gpgsm_get_key_algo_info (ksba_cert_t cert, unsigned int *nbits)
}
/* This is a wrapper around pubkey_algo_string which takesa KSA
* certitificate instead of a Gcrypt public key. Note that this
/* This is a wrapper around pubkey_algo_string which takes a KSBA
* certificate instead of a Gcrypt public key. Note that this
* function may return NULL on error. */
char *
gpgsm_pubkey_algo_string (ksba_cert_t cert, int *r_algoid)