aboutsummaryrefslogtreecommitdiffstats
path: root/agent/cvt-openpgp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-05-14 08:31:46 +0000
committerWerner Koch <[email protected]>2019-05-14 08:31:46 +0000
commit54e96c6fd262bd0090fec836c97d7fdb04bd6129 (patch)
tree93ead3e2aac01b8317d18a31b980f7d7fec5e4e2 /agent/cvt-openpgp.c
parentagent: correct length for uri and comment on 64-bit big-endian platforms (diff)
downloadgnupg-54e96c6fd262bd0090fec836c97d7fdb04bd6129.tar.gz
gnupg-54e96c6fd262bd0090fec836c97d7fdb04bd6129.zip
agent: Replace most assert by log_assert.
--
Diffstat (limited to 'agent/cvt-openpgp.c')
-rw-r--r--agent/cvt-openpgp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c
index 42052d48e..003402956 100644
--- a/agent/cvt-openpgp.c
+++ b/agent/cvt-openpgp.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#include "agent.h"
#include "../common/i18n.h"
@@ -571,7 +570,7 @@ do_unprotect (const char *passphrase,
}
skey[i] = NULL;
skeylen = i;
- assert (skeylen <= skeysize);
+ log_assert (skeylen <= skeysize);
/* Note: at this point NDATA should be 2 for a simple
checksum or 20 for the sha1 digest. */
@@ -1105,8 +1104,8 @@ apply_protection (gcry_mpi_t *array, int npkey, int nskey,
int ndata;
unsigned char *p, *data;
- assert (npkey < nskey);
- assert (nskey < DIM (bufarr));
+ log_assert (npkey < nskey);
+ log_assert (nskey < DIM (bufarr));
/* Collect only the secret key parameters into BUFARR et al and
compute the required size of the data buffer. */
@@ -1143,7 +1142,7 @@ apply_protection (gcry_mpi_t *array, int npkey, int nskey,
xfree (bufarr[i]);
bufarr[i] = NULL;
}
- assert (p == data + ndata - 20);
+ log_assert (p == data + ndata - 20);
/* Append a hash of the secret key parameters. */
gcry_md_hash_buffer (GCRY_MD_SHA1, p, data, ndata - 20);