diff options
author | Matt Caswell <matt@openssl.org> | 2016-06-16 10:07:32 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-16 13:34:44 +0100 |
commit | b84e12266f85156f58804ff94ea110890f13b52d (patch) | |
tree | 32de263358b118264aaf5e0c702cbc5f3637721c /test | |
parent | cf3404fcc77aaf592c95326cbdd25612a8af6878 (diff) |
Fix the build and tests following constification of DH, DSA, RSA
Misc fixes following the constification of the DH, DSA and RSA
getters.
Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/dhtest.c | 20 | ||||
-rw-r--r-- | test/dsatest.c | 2 |
2 files changed, 10 insertions, 12 deletions
diff --git a/test/dhtest.c b/test/dhtest.c index 1dc395b44e..2847c5c038 100644 --- a/test/dhtest.c +++ b/test/dhtest.c @@ -40,8 +40,9 @@ int main(int argc, char *argv[]) BN_GENCB *_cb = NULL; DH *a = NULL; DH *b = NULL; - BIGNUM *ap = NULL, *ag = NULL, *bp = NULL, *bg = NULL, *apub_key = NULL; - BIGNUM *bpub_key = NULL, *priv_key = NULL; + const BIGNUM *ap = NULL, *ag = NULL, *apub_key = NULL, *priv_key = NULL; + const BIGNUM *bpub_key = NULL; + BIGNUM *bp = NULL, *bg = NULL; char buf[12] = {0}; unsigned char *abuf = NULL; unsigned char *bbuf = NULL; @@ -476,6 +477,7 @@ static int run_rfc5114_tests(void) unsigned char *Z2 = NULL; const rfc5114_td *td = NULL; BIGNUM *bady = NULL, *priv_key = NULL, *pub_key = NULL; + const BIGNUM *pub_key_tmp; for (i = 0; i < (int)OSSL_NELEM(rfctd); i++) { td = rfctd + i; @@ -511,17 +513,13 @@ static int run_rfc5114_tests(void) * Work out shared secrets using both sides and compare with expected * values. */ - DH_get0_key(dhB, &pub_key, NULL); - if (DH_compute_key(Z1, pub_key, dhA) == -1) { - pub_key = NULL; + DH_get0_key(dhB, &pub_key_tmp, NULL); + if (DH_compute_key(Z1, pub_key_tmp, dhA) == -1) goto bad_err; - } - DH_get0_key(dhA, &pub_key, NULL); - if (DH_compute_key(Z2, pub_key, dhB) == -1) { - pub_key = NULL; + + DH_get0_key(dhA, &pub_key_tmp, NULL); + if (DH_compute_key(Z2, pub_key_tmp, dhB) == -1) goto bad_err; - } - pub_key = NULL; if (memcmp(Z1, td->Z, td->Z_len)) goto err; diff --git a/test/dsatest.c b/test/dsatest.c index b99c467e17..10854224aa 100644 --- a/test/dsatest.c +++ b/test/dsatest.c @@ -85,7 +85,7 @@ int main(int argc, char **argv) unsigned long h; unsigned char sig[256]; unsigned int siglen; - BIGNUM *p = NULL, *q = NULL, *g = NULL; + const BIGNUM *p = NULL, *q = NULL, *g = NULL; if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT); |