diff options
author | Werner Koch <[email protected]> | 2019-05-14 08:31:46 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-05-14 08:31:46 +0000 |
commit | 54e96c6fd262bd0090fec836c97d7fdb04bd6129 (patch) | |
tree | 93ead3e2aac01b8317d18a31b980f7d7fec5e4e2 /agent/protect.c | |
parent | agent: correct length for uri and comment on 64-bit big-endian platforms (diff) | |
download | gnupg-54e96c6fd262bd0090fec836c97d7fdb04bd6129.tar.gz gnupg-54e96c6fd262bd0090fec836c97d7fdb04bd6129.zip |
agent: Replace most assert by log_assert.
--
Diffstat (limited to 'agent/protect.c')
-rw-r--r-- | agent/protect.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/agent/protect.c b/agent/protect.c index c7fb773e1..e3bbf3ed5 100644 --- a/agent/protect.c +++ b/agent/protect.c @@ -528,7 +528,7 @@ do_encryption (const unsigned char *hashbegin, size_t hashlen, memcpy (p, iv+blklen, blklen); /* Add padding. */ p += blklen; } - assert ( p - outbuf == outlen); + log_assert ( p - outbuf == outlen); if (use_ocb) { gcry_cipher_final (hd); @@ -718,11 +718,11 @@ agent_protect (const unsigned char *plainkey, const char *passphrase, hash_end = s; s++; /* Skip to the end of the S-expression. */ - assert (depth == 1); + log_assert (depth == 1); rc = sskip (&s, &depth); if (rc) return rc; - assert (!depth); + log_assert (!depth); real_end = s-1; rc = do_encryption (hash_begin, hash_end - hash_begin + 1, @@ -760,7 +760,7 @@ agent_protect (const unsigned char *plainkey, const char *passphrase, memcpy (p, prot_end+1, real_end - prot_end); p += real_end - prot_end; - assert ( p - *result == *resultlen); + log_assert ( p - *result == *resultlen); xfree (protected); return 0; @@ -999,7 +999,7 @@ merge_lists (const unsigned char *protectedkey, /* Skip over the protected list element in the original list. */ s = protectedkey + replacepos; - assert (*s == '('); + log_assert (*s == '('); s++; i = 1; rc = sskip (&s, &i); @@ -1026,7 +1026,7 @@ merge_lists (const unsigned char *protectedkey, rc = sskip (&s, &i); if (rc) goto failure; - assert (s[-1] == ')'); + log_assert (s[-1] == ')'); endpos = s; /* one behind the end of the list */ /* Append the rest. */ @@ -1571,7 +1571,7 @@ agent_shadow_key (const unsigned char *pubkey, point = s; /* insert right before the point */ depth--; s++; - assert (depth == 1); + log_assert (depth == 1); /* Calculate required length by taking in account: the "shadowed-" prefix, the "shadowed", "t1-v1" as well as some parenthesis */ |