Skip to content

Commit

Permalink
Bump the DH key size to 256 bytes to avoid EINVAL on my kernel.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey committed Jul 31, 2023
1 parent 1850755 commit 795ba07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct rr_keyctl_dh_params {
};

int main(void) {
char buffer[192];
char buffer[256];

char* data = "Test Data";
key_serial_t key = syscall(SYS_add_key, "user", "RR Test key", data,
Expand All @@ -35,9 +35,9 @@ int main(void) {
test_assert(0 == syscall(SYS_keyctl, KEYCTL_INVALIDATE, key));

#ifdef KEYCTL_DH_COMPUTE
uint8_t base[192] = { 1 };
uint8_t base[256] = { 1 };
// 'prime' must be at least 1536 bits or we get EINVAL.
uint8_t prime[192] = { 7 }; // Not prime but we should be OK
uint8_t prime[256] = { 7 }; // Not prime but we should be OK
uint8_t private = 1; // The world's worst private key
base[191] = 'x';

Expand Down

0 comments on commit 795ba07

Please sign in to comment.