Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 637070 - dev-libs/libsodium: typo in cpuflags patch always disables AES-GCM
Summary: dev-libs/libsodium: typo in cpuflags patch always disables AES-GCM
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-10 17:02 UTC by Manuel Mausz
Modified: 2018-10-05 04:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Mausz 2017-11-10 17:02:47 UTC
There's a typo in the patch resulting in AES-GCM always being disabled:

> [...]
> +AC_ARG_ENABLE(aesni, [AS_HELP_STRING(--disable-aesni,Do not use aesni code)],
> +  AS_IF([test "x$enableval" = "xyes"], check_aeni="yes", check_aesni="no"),
> +  check_aesni="yes")
> +AS_IF([test "$check_aesni" = "yes"],[
> [...]

search for "check_aeni", should be "check_aesni".

Reproducible: Always
Comment 1 Manuel Mausz 2017-11-10 17:04:52 UTC
..."in the patch" meaning the libsodium-1.0.10-cpuflags.patch file.
Comment 2 Manuel Mausz 2017-11-10 17:17:30 UTC
by the way: what's the use for this disable/enable AES patch anyway? AES-GCM is only available if the host cpu supports the AESNI flag. So every client has to check this first by calling crypto_aead_aes256gcm_is_available()
Comment 3 Manuel Mausz 2018-09-17 20:19:06 UTC
Can someone please at least fix the gentoo patch in git? The typo is pretty obvious.

sed -i -e "s/check_aeni/check_aesni/" dev-libs/libsodium/files/libsodium-1.0.10-cpuflags.patch

or:
> --- a/files/libsodium-1.0.10-cpuflags.patch     2018-09-17 22:17:35.397671318 +0200
> +++ b/files/libsodium-1.0.10-cpuflags.patch    2016-06-17 14:36:51.000000000 +0200
> @@ -24,7 +24,7 @@
>     CFLAGS="$oldcflags"
>   
>  +AC_ARG_ENABLE(aesni, [AS_HELP_STRING(--disable-aesni,Do not use aesni code)],
> -+  AS_IF([test "x$enableval" = "xyes"], check_aesni="yes", check_aesni="no"),
> ++  AS_IF([test "x$enableval" = "xyes"], check_aeni="yes", check_aesni="no"),
>  +  check_aesni="yes")
>  +AS_IF([test "$check_aesni" = "yes"],[
>     oldcflags="$CFLAGS"
Comment 4 Larry the Git Cow gentoo-dev 2018-10-05 04:15:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74578f0ade346915d1586d0a3dbe2a8aa5a383c6

commit 74578f0ade346915d1586d0a3dbe2a8aa5a383c6
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-10-05 04:15:36 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-10-05 04:15:36 +0000

    dev-libs/libsodium: fix AES-NI support
    
    Closes: https://bugs.gentoo.org/637070
    Package-Manager: Portage-2.3.50, Repoman-2.3.11
    RepoMan-Options: --force
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-libs/libsodium/Manifest                        |  1 -
 .../files/libsodium-1.0.10-cpuflags.patch          |  2 +-
 ...um-1.0.11.ebuild => libsodium-1.0.11-r1.ebuild} |  2 +-
 ...um-1.0.13.ebuild => libsodium-1.0.14-r1.ebuild} |  2 +-
 dev-libs/libsodium/libsodium-1.0.14.ebuild         | 43 ----------------------
 ...um-1.0.15.ebuild => libsodium-1.0.15-r1.ebuild} |  2 +-
 ...1.0.16-r1.ebuild => libsodium-1.0.16-r2.ebuild} |  2 +-
 dev-libs/libsodium/libsodium-1.0.16.ebuild         | 43 ----------------------
 8 files changed, 5 insertions(+), 92 deletions(-)
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2018-10-05 04:17:01 UTC
Thanks for this report!