b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
26 lines
713 B
C
26 lines
713 B
C
#include <assert.h>
|
|
#include <crypt.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
int main()
|
|
{
|
|
char *expected_output = "$7$C6..../....$SodiumChloride$aAM7wxp7ayfEF.ZLedy2490m85oOR228oZTB7jPbmdG";
|
|
char *result = crypt("pleaseletmein", "$7$C6..../....SodiumChloride");
|
|
assert(strcmp(result, expected_output) == 0);
|
|
|
|
// No salt
|
|
result = crypt("pleaseletmein", "$7$C6..../....");
|
|
assert(result != NULL);
|
|
|
|
// Invalid encoded number for r
|
|
result = crypt("pleaseletmein", "$7$C6.../....SodiumChloride");
|
|
assert(result == NULL);
|
|
|
|
// Invalid encoded number for p
|
|
result = crypt("pleaseletmein", "$7$C6..../...SodiumChloride");
|
|
assert(result == NULL);
|
|
|
|
return 0;
|
|
}
|