Skip to content

crypto: wipe AES key material before free#10344

Open
AskiiDev wants to merge 1 commit intomonero-project:masterfrom
AskiiDev:fix-oaes-memwipe
Open

crypto: wipe AES key material before free#10344
AskiiDev wants to merge 1 commit intomonero-project:masterfrom
AskiiDev:fix-oaes-memwipe

Conversation

@AskiiDev
Copy link

@AskiiDev AskiiDev commented Mar 1, 2026

oaes_key_destroy() frees the AES key and expanded key buffers without clearing them first. This leaves key material in memory until the allocator reuses the blocks. This change wipes both buffers with memwipe() before calling free(), using the same pattern as elsewhere in the codebase.

OpenAES is used by cn_slow_hash(), including for wallet passphrase-derived key derivation; clearing this data reduces exposure of passphrase-derived material in freed heap.

Note: #9508 proposes replacing the alloc-based OAES path with a buffer-based expansion; if that is merged, this change would be superseded. Until then, this wipes key material in the current implementation.

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.

2 participants