<div dir="ltr"><div><div><div>Hi,</div><div><br></div><div>Fixed in the attached patch (included a small typo fix from the other patch, sorry about that).<br><br>> MODE is not an int but enum gcry_cipher_modes and thus it is better to<br>
> use that. Also put all modes into the switch so that the compiler can<br>
> check its completeness and we do not miss to check whether new modes may<br>
> be FIPS compliant.<br><br></div>Not sure if _gcry_cipher_open_internal should also use gcry_cipher_modes. Let me know </div><div>if this is something you want changed since it checks mode as an int as well.<br><br></div>Best,<br></div>Lucas Mülling<br><div><div><div><br></div></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025 at 1:39 PM Werner Koch <<a href="mailto:wk@gnupg.org">wk@gnupg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
On Fri, 24 Jan 2025 10:19, Lucas Mulling said:<br>
<br>
> +int<br>
> +_gcry_cipher_is_mode_fips_compliant(int mode)<br>
<br>
Given that this function returns an error code it should also be<br>
declared as to do this. However, the name of the function indicates<br>
that this returns a boolean status and one would expect true for FIPS<br>
comliance. But the logic is invers. This is fine but the function<br>
should then for example be named _gcry_cipher_mode_fips_compliance.<br>
<br>
MODE is not an int but enum gcry_cipher_modes and thus it is better to<br>
use that. Also put all modes into the switch so that the compiler can<br>
check its completeness and we do not miss to check whether new modes may<br>
be FIPS compliant.<br>
<br>
> @@ -1988,6 +1988,7 @@ char *gcry_get_config (int mode, const char *what);<br>
> #define GCRY_FIPS_FLAG_REJECT_PK (1 << 5)<br>
> #define GCRY_FIPS_FLAG_REJECT_PK_MD (1 << 6)<br>
> #define GCRY_FIPS_FLAG_REJECT_PK_GOST_SM2 (1 << 7)<br>
> +#define GCRY_FIPS_FLAG_REJECT_CIPHER_MODE (1 << 8)<br>
<br>
Do we already have a documentation for these new constants? In any case<br>
it should be put into the NEWS file.<br>
<br>
<br>
<br>
Shalom-Salam,<br>
<br>
Werner<br>
<br>
<br>
-- <br>
The pioneers of a warless world are the youth that<br>
refuse military service. - A. Einstein<br>
</blockquote></div>