diff options
| author | tb <> | 2022-01-14 09:32:27 +0000 |
|---|---|---|
| committer | tb <> | 2022-01-14 09:32:27 +0000 |
| commit | 1a60acc2f6681366c788dddbb29fbcc891f04b09 (patch) | |
| tree | 3e75e93509cf3d5df5a51c3a0bffd4e58ca03f50 /src/regress/lib | |
| parent | 67498e68e869f6e5fad2c89bf72a5baeb3e01b9f (diff) | |
| download | openbsd-1a60acc2f6681366c788dddbb29fbcc891f04b09.tar.gz openbsd-1a60acc2f6681366c788dddbb29fbcc891f04b09.tar.bz2 openbsd-1a60acc2f6681366c788dddbb29fbcc891f04b09.zip | |
Simplify BN_mont test slightly using a new accessor.
Diffstat (limited to 'src/regress/lib')
| -rw-r--r-- | src/regress/lib/libcrypto/bn/mont/mont.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/bn/mont/mont.c b/src/regress/lib/libcrypto/bn/mont/mont.c index 2c311af417..8b9b14a20e 100644 --- a/src/regress/lib/libcrypto/bn/mont/mont.c +++ b/src/regress/lib/libcrypto/bn/mont/mont.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: mont.c,v 1.5 2021/11/26 16:52:07 tb Exp $ */ | 1 | /* $OpenBSD: mont.c,v 1.6 2022/01/14 09:32:27 tb Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * Copyright (c) 2014 Miodrag Vallat. | 4 | * Copyright (c) 2014 Miodrag Vallat. |
| @@ -36,7 +36,6 @@ main(int argc, char *argv[]) | |||
| 36 | { | 36 | { |
| 37 | DH *dh = NULL; | 37 | DH *dh = NULL; |
| 38 | BIGNUM *priv_key = NULL; | 38 | BIGNUM *priv_key = NULL; |
| 39 | const BIGNUM *pub_key; | ||
| 40 | unsigned char *key = NULL; | 39 | unsigned char *key = NULL; |
| 41 | unsigned char r[32 + 16 * 8]; | 40 | unsigned char r[32 + 16 * 8]; |
| 42 | size_t privsz; | 41 | size_t privsz; |
| @@ -65,8 +64,7 @@ main(int argc, char *argv[]) | |||
| 65 | key = malloc(DH_size(dh)); | 64 | key = malloc(DH_size(dh)); |
| 66 | if (key == NULL) | 65 | if (key == NULL) |
| 67 | err(1, "malloc"); | 66 | err(1, "malloc"); |
| 68 | DH_get0_key(dh, &pub_key, NULL); | 67 | if (DH_compute_key(key, DH_get0_pub_key(dh), dh) == -1) |
| 69 | if (DH_compute_key(key, pub_key, dh) == -1) | ||
| 70 | goto err; | 68 | goto err; |
| 71 | 69 | ||
| 72 | free(key); | 70 | free(key); |
