1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

agent: Replace most assert by log_assert.

--
This commit is contained in:
Werner Koch 2019-05-14 10:31:46 +02:00
parent 5651b2c460
commit 54e96c6fd2
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
17 changed files with 42 additions and 60 deletions

View file

@ -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 */