I want correct typing mistakes when booting from softraid crypto disks. Can we handle at least the backspace key, plz^Hease? :)
diff --git sys/arch/amd64/stand/libsa/softraid.c sys/arch/amd64/stand/libsa/softraid.c index 336865a..801cec4 100644 --- sys/arch/amd64/stand/libsa/softraid.c +++ sys/arch/amd64/stand/libsa/softraid.c @@ -557,6 +557,10 @@ sr_crypto_decrypt_keys(struct sr_boot_volume *bv) c = cngetc(); if (c == '\r' || c == '\n') break; + else if (c == '\b') { + i = i > 0 ? i - 2 : -1; + continue; + } passphrase[i] = (c & 0xff); } passphrase[i] = 0; diff --git sys/arch/i386/stand/libsa/softraid.c sys/arch/i386/stand/libsa/softraid.c index 336865a..801cec4 100644 --- sys/arch/i386/stand/libsa/softraid.c +++ sys/arch/i386/stand/libsa/softraid.c @@ -557,6 +557,10 @@ sr_crypto_decrypt_keys(struct sr_boot_volume *bv) c = cngetc(); if (c == '\r' || c == '\n') break; + else if (c == '\b') { + i = i > 0 ? i - 2 : -1; + continue; + } passphrase[i] = (c & 0xff); } passphrase[i] = 0; diff --git sys/arch/sparc64/stand/ofwboot/softraid.c sys/arch/sparc64/stand/ofwboot/softraid.c index 1dadfdb..7654194 100644 --- sys/arch/sparc64/stand/ofwboot/softraid.c +++ sys/arch/sparc64/stand/ofwboot/softraid.c @@ -572,6 +572,10 @@ sr_crypto_decrypt_keys(struct sr_boot_volume *bv) c = getchar(); if (c == '\r' || c == '\n') break; + else if (c == '\b') { + i = i > 0 ? i - 2 : -1; + continue; + } passphrase[i] = (c & 0xff); } passphrase[i] = 0;