diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-08-20 22:20:13 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-08-20 22:20:13 +0000 |
commit | 2b77106bc9a5d01e34b31d7f9a0cfcef8ea84f69 (patch) | |
tree | e1eefa281322536e6031ffbf588be7a6af2f914b | |
parent | d588bba9912a64b32c1f792ede05d79135fae60b (diff) |
Use a separate flags variable for the error flags in DH_check()
-rw-r--r-- | regress/lib/libcrypto/dh/dhtest.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/regress/lib/libcrypto/dh/dhtest.c b/regress/lib/libcrypto/dh/dhtest.c index 00eb23079fd..41bc0b2e2d5 100644 --- a/regress/lib/libcrypto/dh/dhtest.c +++ b/regress/lib/libcrypto/dh/dhtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhtest.c,v 1.12 2023/08/12 06:30:43 tb Exp $ */ +/* $OpenBSD: dhtest.c,v 1.13 2023/08/20 22:20:12 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -98,7 +98,8 @@ main(int argc, char *argv[]) BN_GENCB *_cb; DH *dh = NULL; unsigned char *buf = NULL; - int i, buf_len, secret_len; + int flags, buf_len, secret_len; + int i; int ret = 1; if ((_cb = BN_GENCB_new()) == NULL) @@ -118,15 +119,15 @@ main(int argc, char *argv[]) if (!DH_generate_parameters_ex(dh, 64, DH_GENERATOR_5, _cb)) goto err; - if (!DH_check(dh, &i)) + if (!DH_check(dh, &flags)) goto err; - if (i & DH_CHECK_P_NOT_PRIME) + if (flags & DH_CHECK_P_NOT_PRIME) printf("p value is not prime\n"); - if (i & DH_CHECK_P_NOT_SAFE_PRIME) + if (flags & DH_CHECK_P_NOT_SAFE_PRIME) printf("p value is not a safe prime\n"); - if (i & DH_UNABLE_TO_CHECK_GENERATOR) + if (flags & DH_UNABLE_TO_CHECK_GENERATOR) printf("unable to check the generator value\n"); - if (i & DH_NOT_SUITABLE_GENERATOR) + if (flags & DH_NOT_SUITABLE_GENERATOR) printf("the g value is not a generator\n"); printf("\np = "); |