Remove JS functions: hmacsha256sign, hmac2ha256verify, parseHttpRequest, sha1Digest, and maskBytes. These are no longer needed with httpd and auth in C

This commit is contained in:
2024-04-02 21:33:51 -04:00
parent 68e8c010b7
commit 9cb872eec2
3 changed files with 0 additions and 219 deletions

View File

@ -630,37 +630,6 @@ static void _test_file(const tf_test_options_t* options)
unlink("out/test.js");
}
static void _test_sign(const tf_test_options_t* options)
{
_write_file("out/test.js",
"'use strict';\n"
"let id = ssb.createIdentity('test');\n"
"print(id);\n"
"let sig = ssb.hmacsha256sign('hello', 'test', id);\n"
"print(sig);\n"
"if (!ssb.hmacsha256verify(id, 'hello', sig)) {\n"
" exit(1);\n"
"}\n"
"if (ssb.hmacsha256verify(id, 'world', sig)) {\n"
" exit(1);\n"
"}\n"
"if (ssb.hmacsha256verify(id, 'hello1', sig)) {\n"
" exit(1);\n"
"}\n");
unlink("out/test_db0.sqlite");
char command[256];
snprintf(command, sizeof(command), "%s run --db-path=out/test_db0.sqlite -s out/test.js" TEST_ARGS, options->exe_path);
tf_printf("%s\n", command);
int result = system(command);
tf_printf("returned %d\n", WEXITSTATUS(result));
assert(WIFEXITED(result));
assert(WEXITSTATUS(result) == 0);
unlink("out/test_db0.sqlite");
unlink("out/test.js");
}
static void _test_b64(const tf_test_options_t* options)
{
_write_file("out/test.js",
@ -925,7 +894,6 @@ void tf_tests(const tf_test_options_t* options)
_tf_test_run(options, "float", _test_float, false);
_tf_test_run(options, "socket", _test_socket, false);
_tf_test_run(options, "file", _test_file, false);
_tf_test_run(options, "sign", _test_sign, false);
_tf_test_run(options, "b64", _test_b64, false);
_tf_test_run(options, "rooms", tf_ssb_test_rooms, false);
_tf_test_run(options, "bench", tf_ssb_test_bench, false);