[PATCH 1/2] [v3] Add API to support AEAD cipher modes

Werner Koch wk at gnupg.org
Tue Oct 22 16:31:13 CEST 2013

On Tue, 22 Oct 2013 15:49, jussi.kivilinna at iki.fi said:
> Do these look ok to push?

Yes; but see below.

>> +gcry_error_t
>> +_gcry_cipher_authenticate (gcry_cipher_hd_t hd, const void *abuf,
>> +                           size_t abuflen)
>> +{
>> +  log_fatal ("gcry_cipher_authenticate: invalid mode %d\n", hd->mode);
>> +
>> +  (void)abuf;
>> +  (void)abuflen;
>> +
>> +  return gpg_error (GPG_ERR_INV_CIPHER_MODE);

Sure that you want log_fatal here?  This calls abort and thus
terminates the process.  I think it is better to use log_error.  Or do
you fear that callers do not check the return code?  Maybe we can add an
error state to gcry_cipher_hd_t to let all further operation fail.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gcrypt-devel mailing list