Files
RedBear-OS/recipes/tests/crypt/blowfish.c
T
vasilito b9874d0941 feat: USB storage read/write proof + full Red Bear OS tree sync
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.
2026-05-03 23:03:24 +01:00

27 lines
862 B
C

#include <assert.h>
#include <crypt.h>
#include <string.h>
#include <unistd.h>
int main()
{
char *expected_output = "$2y$12$CJr4uRfziaGp4CWIBk0fB.I2tCOHYe3pomaWbC53/92p";
char *result = crypt("correctbatteryhorsestapler", "$2y$12$L6Bc/AlTQHyd9liGgGEZyO");
assert(strcmp(result, expected_output) == 0);
// Invalid salt for Blowfish
result = crypt("correctbatteryhorsestapler", "$2t$12$L6Bc/AlTQHyd9liGgGEZyO");
assert(result == NULL);
expected_output = "$2a$4$IAwt7hxuME3DekssMMTWU.xnJub2Xn45xK/oP.wWt3UC";
result = crypt("password", "$2a$04$UuTkLRZZ6QofpDOlMz32Mu");
assert(strcmp(result, expected_output) == 0);
// Invalid salt for Blowfish
result = "$2b$10$testtesttesttes";
result = crypt("correctbatteryhorsestapler", "$2y$12$L6Bc/AlTQHyd9liGgGEZyO");
assert(result != NULL);
return 0;
}