Skip to content

Commit

Permalink
Set secure store callback for KAT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashman-p committed Oct 21, 2023
1 parent 588c3a1 commit 074e4f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/kat_sig_stfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) {
unsigned long long sigs_remain = 0;
unsigned long long sigs_maximum = 0;
OQS_STATUS rc, ret = OQS_ERROR;
char *context = NULL;

sig = OQS_SIG_STFL_new(method_name);
if (sig == NULL) {
Expand All @@ -165,7 +166,8 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) {
// Grab the pk and sk from KAT file
public_key = malloc(sig->length_public_key);
secret_key = OQS_SIG_STFL_SECRET_KEY_new(sig->method_name);
OQS_SIG_STFL_SECRET_KEY_SET_store_cb(secret_key, do_nothing_save, NULL);
context = strdup(method_name);
OQS_SIG_STFL_SECRET_KEY_SET_store_cb(secret_key, do_nothing_save, (void *)context);

signature = calloc(sig->length_signature, sizeof(uint8_t));
signature_kat = calloc(sig->length_signature, sizeof(uint8_t));
Expand Down Expand Up @@ -286,6 +288,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) {
OQS_MEM_insecure_free(signature_kat);
OQS_MEM_insecure_free(msg);
OQS_MEM_insecure_free(msg_rand);
OQS_MEM_insecure_free(context);
OQS_SIG_STFL_free(sig);
fclose(fp_rsp);
return ret;
Expand Down

0 comments on commit 074e4f5

Please sign in to comment.