summaryrefslogtreecommitdiff
path: root/test/ssltest_old.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-06 17:49:48 +0100
committerMatt Caswell <matt@openssl.org>2016-04-09 10:10:55 +0100
commit0aeddcfa61250a6c474c4f8b3533772a63192f1b (patch)
treed8ac8b14fc1bd8a365d522a0ecf0fc9999c01575 /test/ssltest_old.c
parentb9aec69ace2ae84b2b4494cc49725945805d5a29 (diff)
downloadopenssl-new-0aeddcfa61250a6c474c4f8b3533772a63192f1b.tar.gz
Make DH opaque
Move the dh_st structure into an internal header file and provide relevant accessors for the internal fields. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/ssltest_old.c')
-rw-r--r--test/ssltest_old.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/test/ssltest_old.c b/test/ssltest_old.c
index e3f8d774cb..2cc25db018 100644
--- a/test/ssltest_old.c
+++ b/test/ssltest_old.c
@@ -3527,13 +3527,16 @@ static DH *get_dh512()
0x02,
};
DH *dh;
+ BIGNUM *p, *g;
if ((dh = DH_new()) == NULL)
return (NULL);
- dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
- dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
- if ((dh->p == NULL) || (dh->g == NULL)) {
+ p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
+ g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
+ if ((p == NULL) || (g == NULL) || !DH_set0_pqg(dh, p, NULL, g)) {
DH_free(dh);
+ BN_free(p);
+ BN_free(g);
return (NULL);
}
return (dh);
@@ -3568,13 +3571,16 @@ static DH *get_dh1024()
0x02,
};
DH *dh;
+ BIGNUM *p, *g;
if ((dh = DH_new()) == NULL)
return (NULL);
- dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
- dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
- if ((dh->p == NULL) || (dh->g == NULL)) {
+ p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
+ g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
+ if ((p == NULL) || (g == NULL) || !DH_set0_pqg(dh, p, NULL, g)) {
DH_free(dh);
+ BN_free(p);
+ BN_free(g);
return (NULL);
}
return (dh);
@@ -3629,16 +3635,19 @@ static DH *get_dh1024dsa()
0x07, 0xE7, 0x68, 0x1A, 0x82, 0x5D, 0x32, 0xA2,
};
DH *dh;
+ BIGNUM *p, *g;
if ((dh = DH_new()) == NULL)
return (NULL);
- dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
- dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
- if ((dh->p == NULL) || (dh->g == NULL)) {
+ p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
+ g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
+ if ((p == NULL) || (g == NULL) || !DH_set0_pqg(dh, p, NULL, g)) {
DH_free(dh);
+ BN_free(p);
+ BN_free(g);
return (NULL);
}
- dh->length = 160;
+ DH_set_length(dh, 160);
return (dh);
}
#endif