Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Kernel Crypto API produces garbage for AES #25

Open
gpshead opened this issue Feb 7, 2023 · 0 comments
Open

Linux Kernel Crypto API produces garbage for AES #25

gpshead opened this issue Feb 7, 2023 · 0 comments

Comments

@gpshead
Copy link

gpshead commented Feb 7, 2023

Steps to reproduce

  1. Install a system with Debian using the (currently latest available) starfive-jh7110-VF2_515_v2.5.0-69.img image linked to from https://debian.starfivetech.com/ & set the system up with build tools. then do:
mkdir repro-bad-aes && cd repro-bad-aes
git clone https://github.com/python/cpython -b 3.11
mkdir build && cd build
../cpython/configure && make -j4
./python -m test -v test_socket -m '*LinuxKernelCrypto*'

Failures

======================================================================
FAIL: test_aead_aes_gcm (test.test_socket.LinuxKernelCryptoAPI.test_aead_aes_gcm)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../cpython/Lib/test/test_socket.py", line 6507, in test_aead_aes_gcm
    self.assertEqual(expected_ct, res[assoclen:-taglen])
AssertionError: b'\x93\xfe}\x9e\x9b\xfd\x104\x8aV\x06\xe5\xca\xfasT' != b'^\xcb\x8e3\x7f\xd2wN\xc2W\xccH\xe6\xa1T\x0e'

======================================================================
FAIL: test_aes_cbc (test.test_socket.LinuxKernelCryptoAPI.test_aes_cbc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../cpython/Lib/test/test_socket.py", line 6451, in test_aes_cbc
    self.assertEqual(op.recv(msglen), msg)
AssertionError: b'\x06\x8c\x86gk\x0b@0\xbdt^\xfa\xed\xb4:\xa7' != b'Single block msg'

The other LinuxKernelCryptoAPI tests pass, it seems to be the ones attempting to use AES that produce garbage.

$ uname -a
Linux starfive 5.15.0-starfive #1 SMP Mon Dec 19 07:56:37 EST 2022 riscv64 GNU/Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant