2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/crypto/krb5
David Howells eed848871c crypto/krb5: Fix change to use SG miter to use offset
The recent patch to make the rfc3961 simplified code use sg_miter rather
than manually walking the scatterlist to hash the contents of a buffer
described by that scatterlist failed to take the starting offset into
account.

This is indicated by the selftests reporting:

    krb5: Running aes128-cts-hmac-sha256-128 mic
    krb5: !!! TESTFAIL crypto/krb5/selftest.c:446
    krb5: MIC mismatch

Fix this by calling sg_miter_skip() before doing the loop to advance
by the offset.

This only affects packet signing modes and not full encryption in RxGK
because, for full encryption, the message digest is handled inside the
authenc and krb5enc drivers.

Note: Nothing in linus/master uses the krb5lib, though the bug is there.
It is used by AF_RXRPC's RxGK implementation in -next, no need to backport.

Fixes: da6f9bf40a ("crypto: krb5 - Use SG miter instead of doing it by hand")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Chuck Lever <chuck.lever@oracle.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://patch.msgid.link/3824017.1745835726@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-29 11:28:50 -07:00
..
internal.h crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00
Kconfig crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00
krb5_api.c crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00
krb5_kdf.c crypto/krb5: Provide infrastructure and key derivation 2025-03-02 21:47:07 +00:00
Makefile crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00
rfc3961_simplified.c crypto/krb5: Fix change to use SG miter to use offset 2025-04-29 11:28:50 -07:00
rfc3962_aes.c crypto/krb5: Implement the AES enctypes from rfc3962 2025-03-02 21:52:48 +00:00
rfc6803_camellia.c crypto/krb5: Implement the Camellia enctypes from rfc6803 2025-03-02 21:55:23 +00:00
rfc8009_aes2.c crypto/krb5: Implement the AES enctypes from rfc8009 2025-03-02 21:53:55 +00:00
selftest_data.c crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00
selftest.c crypto/krb5: Implement crypto self-testing 2025-03-02 21:56:47 +00:00