Skip to content

Log full encKey and hmacKey every time a message is sent - #102

Draft
GeorgeMcLellan wants to merge 7 commits into
masterfrom
log-entire-keys
Draft

Log full encKey and hmacKey every time a message is sent#102
GeorgeMcLellan wants to merge 7 commits into
masterfrom
log-entire-keys

Conversation

@GeorgeMcLellan

@GeorgeMcLellan GeorgeMcLellan commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

NOT TO BE MERGED INTO MASTER

To debug why the "HMAC Signature does not match" error is occurring since ios 18.1, I have added some logs to dump the entire encKey and hmacKey for every message that is sent from POS, along with the encrypted message and the HMAC signature.
This is just for debugging, not to be pushed to production.

Here are some random idea I have that might be good to identify:

  • Are these keys cleared/modified in memory at any point in time?
  • Is there any point in time where the value of spiMessageStamp.secrets differs to the secrets property in SPIClient? Could there be issues that arise from having the secrets stored in two different locations (self.secrets & self.spiMessageStamp.secrets)?
  • Could there be a mismatch that occurs between encKey/hmacKey and encKeyData/hmacKeyData? We have previously added logs for encKey & hmacKey and it appears these do not change when this hmac issue occurs. However, it is encKeyData & hmacKeyData that are actually used for encryption & HMAC. They are initialised when creating SPISecrets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants