summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/dh/dhtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libcrypto/dh/dhtest.c')
-rw-r--r--src/regress/lib/libcrypto/dh/dhtest.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/dh/dhtest.c b/src/regress/lib/libcrypto/dh/dhtest.c
index 916d7aeff0..9851c4f0c6 100644
--- a/src/regress/lib/libcrypto/dh/dhtest.c
+++ b/src/regress/lib/libcrypto/dh/dhtest.c
@@ -86,10 +86,6 @@ int main(int argc, char *argv[])
86 int i,alen,blen,aout,bout,ret=1; 86 int i,alen,blen,aout,bout,ret=1;
87 BIO *out; 87 BIO *out;
88 88
89 CRYPTO_malloc_debug_init();
90 CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
91 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
92
93 out=BIO_new(BIO_s_file()); 89 out=BIO_new(BIO_s_file());
94 if (out == NULL) exit(1); 90 if (out == NULL) exit(1);
95 BIO_set_fp(out,stdout,BIO_NOCLOSE); 91 BIO_set_fp(out,stdout,BIO_NOCLOSE);
@@ -141,7 +137,7 @@ int main(int argc, char *argv[])
141 BIO_puts(out,"\n"); 137 BIO_puts(out,"\n");
142 138
143 alen=DH_size(a); 139 alen=DH_size(a);
144 abuf=(unsigned char *)OPENSSL_malloc(alen); 140 abuf=malloc(alen);
145 aout=DH_compute_key(abuf,b->pub_key,a); 141 aout=DH_compute_key(abuf,b->pub_key,a);
146 142
147 BIO_puts(out,"key1 ="); 143 BIO_puts(out,"key1 =");
@@ -153,7 +149,7 @@ int main(int argc, char *argv[])
153 BIO_puts(out,"\n"); 149 BIO_puts(out,"\n");
154 150
155 blen=DH_size(b); 151 blen=DH_size(b);
156 bbuf=(unsigned char *)OPENSSL_malloc(blen); 152 bbuf=malloc(blen);
157 bout=DH_compute_key(bbuf,a->pub_key,b); 153 bout=DH_compute_key(bbuf,a->pub_key,b);
158 154
159 BIO_puts(out,"key2 ="); 155 BIO_puts(out,"key2 =");
@@ -173,8 +169,8 @@ int main(int argc, char *argv[])
173err: 169err:
174 ERR_print_errors_fp(stderr); 170 ERR_print_errors_fp(stderr);
175 171
176 if (abuf != NULL) OPENSSL_free(abuf); 172 free(abuf);
177 if (bbuf != NULL) OPENSSL_free(bbuf); 173 free(bbuf);
178 if(b != NULL) DH_free(b); 174 if(b != NULL) DH_free(b);
179 if(a != NULL) DH_free(a); 175 if(a != NULL) DH_free(a);
180 BIO_free(out); 176 BIO_free(out);