Skip to content

Commit

Permalink
add a check so we don't overwrite data
Browse files Browse the repository at this point in the history
  • Loading branch information
ducnguyen-sb committed Sep 8, 2023
1 parent 393f09c commit e7cbe8e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_secret_key_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ OQS_STATUS OQS_SECRET_KEY_XMSS_deserialize_key(OQS_SIG_STFL_SECRET_KEY *sk, cons
return OQS_ERROR;
}

if (sk->secret_key_data) {
// Key data already present
// We dont want to trample over data
return OQS_ERROR;
}

memcpy(sk->secret_key_data, sk_buf, sk_len);

return OQS_SUCCESS;
Expand Down

0 comments on commit e7cbe8e

Please sign in to comment.