Skip to content

Commit

Permalink
Makes sure to write new key to temporary memory
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornvolcker committed Dec 18, 2024
1 parent 007fed3 commit 3d69d3d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/check/test_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ static char private_key_rsa[RSA_PRIVATE_KEY_ALLOC_BYTES];
static size_t private_key_size_rsa;
static char private_key_ecdsa[ECDSA_PRIVATE_KEY_ALLOC_BYTES];
static size_t private_key_size_ecdsa;
static char new_private_key_rsa[RSA_PRIVATE_KEY_ALLOC_BYTES];
static size_t new_private_key_size_rsa;
static char new_private_key_ecdsa[ECDSA_PRIVATE_KEY_ALLOC_BYTES];
static size_t new_private_key_size_ecdsa;

/* Pull SEIs from the signed_video_t session |sv| and prepend them to the test stream |item|. */
static int
Expand Down Expand Up @@ -385,11 +389,11 @@ get_initialized_signed_video(struct sv_setting settings, bool new_private_key)
size_t *private_key_size;

if (settings.ec_key) {
private_key = private_key_ecdsa;
private_key_size = &private_key_size_ecdsa;
private_key = new_private_key ? new_private_key_ecdsa : private_key_ecdsa;
private_key_size = new_private_key ? &new_private_key_size_ecdsa : &private_key_size_ecdsa;
} else {
private_key = private_key_rsa;
private_key_size = &private_key_size_rsa;
private_key = new_private_key ? new_private_key_rsa : private_key_rsa;
private_key_size = new_private_key ? &new_private_key_size_rsa : &private_key_size_rsa;
}

// Generating private keys takes some time. In unit tests a new private key is only
Expand Down

0 comments on commit 3d69d3d

Please sign in to comment.