mirror of https://github.com/wolfSSL/wolfBoot.git
security_command_passphrase() copies the plaintext disk-unlock secret into the file-static DMA buffer `buffer` at ATA_SECURITY_PASSWORD_OFFSET but never wipes it. On the slot<0 early return no ATA command is even dispatched, and on failures of ata_security_set_password()/ ata_security_unlock_device() (which sata_unlock_disk() turns into a panic()) no later IDENTIFY DMA ever overwrites it, so the secret is left resident in BSS for as long as the device stays powered. Zeroize the password field on the slot<0 path and after synchronous command completion. The async path (used only by the currently unreachable ata_security_erase_unit()) is left untouched because the HBA may still be DMAing out of the buffer when exec_cmd_slot_ex() returns ATA_ERR_BUSY; wiping it there would race the transfer. |
||
|---|---|---|
| .. | ||
| Makefile | ||
| README.md | ||
| arm_cmse.h | ||
| gpt-sfdisk-test.h | ||
| target.h | ||
| txt_filler.h | ||
| unit-ahci-unlock-panic.c | ||
| unit-arm-tee-psa-ipc.c | ||
| unit-ata-security-passphrase-zeroize.c | ||
| unit-boot-x86_fsp.c | ||
| unit-common.c | ||
| unit-delta.c | ||
| unit-disk.c | ||
| unit-elf-bss-guard.c | ||
| unit-enc-nvm.c | ||
| unit-extflash.c | ||
| unit-fdt.c | ||
| unit-fit-fpga.c | ||
| unit-fit-gzip.c | ||
| unit-flash-erase-c0.c | ||
| unit-flash-erase-g0.c | ||
| unit-flash-erase-h7.c | ||
| unit-flash-erase-l0.c | ||
| unit-flash-erase-u3.c | ||
| unit-flash-erase-wb.c | ||
| unit-fwtpm-nv-oob.c | ||
| unit-fwtpm-stub.c | ||
| unit-gzip.c | ||
| unit-image.c | ||
| unit-keygen-xmss-params.c | ||
| unit-keystore.c | ||
| unit-linux-loader-e820.c | ||
| unit-linux-loader-syssize.c | ||
| unit-loader-tpm-init.c | ||
| unit-max-space.c | ||
| unit-mock-flash.c | ||
| unit-mock-state.c | ||
| unit-mpusize.c | ||
| unit-multiboot.c | ||
| unit-nvm.c | ||
| unit-otp-keystore.c | ||
| unit-parser.c | ||
| unit-pci.c | ||
| unit-pkcs11_store.c | ||
| unit-policy-create.c | ||
| unit-policy-sign.c | ||
| unit-psa_store.c | ||
| unit-qspi-flash.c | ||
| unit-rot-auth.c | ||
| unit-sdhci-disk-unaligned.c | ||
| unit-sdhci-response-bits.c | ||
| unit-sectorflags.c | ||
| unit-sign-custom-tlv-le.py | ||
| unit-sign-delta-cert-inv-off.py | ||
| unit-sign-delta-tlv.py | ||
| unit-sign-encrypted-output.c | ||
| unit-sign-encrypted-output.mkfrag | ||
| unit-spi-flash.c | ||
| unit-store-sbrk.c | ||
| unit-string.c | ||
| unit-tpm-api-names.c | ||
| unit-tpm-blob.c | ||
| unit-tpm-check-rot-auth.c | ||
| unit-tpm-rsa-exp.c | ||
| unit-uart-flash.c | ||
| unit-update-disk-oob.c | ||
| unit-update-disk.c | ||
| unit-update-flash-hwswap.c | ||
| unit-update-flash.c | ||
| unit-update-ram-enc.c | ||
| unit-update-ram-nofixed.c | ||
| unit-update-ram-noramboot.c | ||
| unit-update-ram.c | ||
| unit-va416x0-fram.c | ||
| unit-wolfhsm_flash_hal.c | ||
| unit-x86-paging-oob.c | ||
README.md
Unit Test Tools
This uses the "check" unit test framework for C.
You may need to run "apt install check", "yum install check" or "brew install check".
Building
Use make to build.
Expected output
$ ./unit-parser
Running suite(s): wolfBoot
Explicit end of options reached
This field is too large (bigger than the space available in the current header)
This field is too large and would overflow the image header
Illegal address (too high)
Illegal address (too high)
100%: Checks: 2, Failures: 0, Errors: 0