lil-skelly / erebos

Fractionated Cavity Loader for Linux LKMs
GNU Affero General Public License v3.0
5 stars 3 forks source link

RSA decryption problems: RSA_padding_check_PKCS1_OAEP_mgf1 #41

Closed lil-skelly closed 4 weeks ago

lil-skelly commented 4 weeks ago

Describe the bug On the client, trying to decrypt the RSA-encrypted AES key throws an error:

40776EA7DE760000:error:02000079:rsa routines:RSA_padding_check_PKCS1_OAEP_mgf1:oaep decoding error:crypto/rsa/rsa_oaep.c:308:

To Reproduce Steps to reproduce the behavior:

  1. Spin up the server
  2. Execute the client
  3. See error

Expected behavior The AES key decrypts as expected and program flow continues normally.

Additional context As far as I am concerned, the error is inside the client. The server properly loads the public key from the client and encrypts the AES key before sending it back, base64 encoded. The client successfully receives and decodes the base64 encoded key, but fails to decrypt the data (using RSA OAEP and its previously generated private key).

lil-skelly commented 4 weeks ago

Fixed with commit https://github.com/lil-skelly/erebos/commit/beabdd5ac9d64619cdb9269bc8e171e2ffcb2763