Added sha256 hash function and hmac functions (with and without salt) to the kernel
and userspace. In userspace, this is accessed through #include <secure.h> In the kernel, this is access through #include <kern/secure.h> There is a unit test for this (hm1) that computes the hmac and compares it to the known value. The salted vesion tested offline. ----- Also, fixed usespace compile issue with not changing KERNEL_SECRET => SECRET.
This commit is contained in:
@@ -16,7 +16,7 @@ tprintf(const char *fmt, ...)
|
||||
int chars;
|
||||
va_list ap;
|
||||
|
||||
if (strcmp(KERNEL_SECRET, "") != 0) {
|
||||
if (SECRET != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ nprintf(const char *fmt, ...)
|
||||
int chars;
|
||||
va_list ap;
|
||||
|
||||
if (strcmp(KERNEL_SECRET, "") == 0) {
|
||||
if (SECRET == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ printsf(const char *fmt, ...)
|
||||
int chars;
|
||||
va_list ap;
|
||||
|
||||
if (strcmp(KERNEL_SECRET, "") != 0) {
|
||||
printf("%s: ", KERNEL_SECRET);
|
||||
if (SECRET != 0) {
|
||||
printf("%llu: ", (unsigned long long)SECRET);
|
||||
}
|
||||
va_start(ap, fmt);
|
||||
chars = vprintf(fmt, ap);
|
||||
|
Reference in New Issue
Block a user