aboutsummaryrefslogtreecommitdiff
path: root/crypto/dh
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/Makefile.ssl2
-rw-r--r--crypto/dh/dh.h8
-rw-r--r--crypto/dh/dh_check.c6
-rw-r--r--crypto/dh/dh_err.c10
-rw-r--r--crypto/dh/dh_gen.c11
-rw-r--r--crypto/dh/dh_key.c2
-rw-r--r--crypto/dh/dh_lib.c4
-rw-r--r--crypto/dh/dhtest.c19
-rw-r--r--crypto/dh/p1024.c2
-rw-r--r--crypto/dh/p192.c2
-rw-r--r--crypto/dh/p512.c2
11 files changed, 38 insertions, 30 deletions
diff --git a/crypto/dh/Makefile.ssl b/crypto/dh/Makefile.ssl
index 7e0c1e1..dfa7e45 100644
--- a/crypto/dh/Makefile.ssl
+++ b/crypto/dh/Makefile.ssl
@@ -79,6 +79,6 @@ clean:
errors:
perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h
- perl ../err/err_genc.pl $(ERR).h $(ERRC).c
+ perl ../err/err_genc.pl -s $(ERR).h $(ERRC).c
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h
index 4497802..4cc1df2 100644
--- a/crypto/dh/dh.h
+++ b/crypto/dh/dh.h
@@ -1,5 +1,5 @@
/* crypto/dh/dh.h */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -106,13 +106,13 @@ DH * DH_new(void);
void DH_free(DH *dh);
int DH_size(DH *dh);
DH * DH_generate_parameters(int prime_len,int generator,
- void (*callback)(int,int));
+ void (*callback)(int,int,char *),char *cb_arg);
int DH_check(DH *dh,int *codes);
int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key,BIGNUM *pub_key,DH *dh);
DH * d2i_DHparams(DH **a,unsigned char **pp, long length);
int i2d_DHparams(DH *a,unsigned char **pp);
-#ifndef WIN16
+#ifndef NO_FP_API
int DHparams_print_fp(FILE *fp, DH *x);
#endif
#ifdef HEADER_BIO_H
@@ -133,7 +133,7 @@ int DH_generate_key();
int DH_compute_key();
DH * d2i_DHparams();
int i2d_DHparams();
-#ifndef WIN16
+#ifndef NO_FP_API
int DHparams_print_fp();
#endif
int DHparams_print();
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
index 8da8dc8..65602e4 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -1,5 +1,5 @@
/* crypto/dh/dh_check.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -104,12 +104,12 @@ int *ret;
else
*ret|=DH_UNABLE_TO_CHECK_GENERATOR;
- if (!BN_is_prime(dh->p,BN_prime_checks,NULL,ctx))
+ if (!BN_is_prime(dh->p,BN_prime_checks,NULL,ctx,NULL))
*ret|=DH_CHECK_P_NOT_PRIME;
else
{
if (!BN_rshift1(q,dh->p)) goto err;
- if (!BN_is_prime(q,BN_prime_checks,NULL,ctx))
+ if (!BN_is_prime(q,BN_prime_checks,NULL,ctx,NULL))
*ret|=DH_CHECK_P_NOT_STRONG_PRIME;
}
ok=1;
diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c
index 1950f43..9d5c06a 100644
--- a/crypto/dh/dh_err.c
+++ b/crypto/dh/dh_err.c
@@ -60,6 +60,7 @@
#include "dh.h"
/* BEGIN ERROR CODES */
+#ifndef NO_ERR
static ERR_STRING_DATA DH_str_functs[]=
{
{ERR_PACK(0,DH_F_DHPARAMS_PRINT,0), "DHparams_print"},
@@ -77,14 +78,19 @@ static ERR_STRING_DATA DH_str_reasons[]=
{0,NULL},
};
+#endif
+
void ERR_load_DH_strings()
{
static int init=1;
- if (init)
- {
+ if (init);
+ {;
init=0;
+#ifndef NO_ERR
ERR_load_strings(ERR_LIB_DH,DH_str_functs);
ERR_load_strings(ERR_LIB_DH,DH_str_reasons);
+#endif
+
}
}
diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c
index ff4f18e..04c7046 100644
--- a/crypto/dh/dh_gen.c
+++ b/crypto/dh/dh_gen.c
@@ -1,5 +1,5 @@
/* crypto/dh/dh_gen.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -83,10 +83,11 @@
* this generator function can take a very very long time to run.
*/
-DH *DH_generate_parameters(prime_len,generator,callback)
+DH *DH_generate_parameters(prime_len,generator,callback,cb_arg)
int prime_len;
int generator;
-void (*callback)(P_I_I);
+void (*callback)(P_I_I_P);
+char *cb_arg;
{
BIGNUM *p=NULL,*t1,*t2;
DH *ret=NULL;
@@ -125,9 +126,9 @@ void (*callback)(P_I_I);
else
g=generator;
- p=BN_generate_prime(prime_len,1,t1,t2,callback);
+ p=BN_generate_prime(prime_len,1,t1,t2,callback,cb_arg);
if (p == NULL) goto err;
- if (callback != NULL) callback(3,0);
+ if (callback != NULL) callback(3,0,cb_arg);
ret->p=p;
ret->g=BN_new();
if (!BN_set_word(ret->g,g)) goto err;
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 12f47c4..7576772 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -1,5 +1,5 @@
/* crypto/dh/dh_key.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 786a2c1..a300b38 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -1,5 +1,5 @@
/* crypto/dh/dh_lib.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -61,7 +61,7 @@
#include "bn.h"
#include "dh.h"
-char *DH_version="Diffie-Hellman part of SSLeay 0.8.1b 29-Jun-1998";
+char *DH_version="Diffie-Hellman part of SSLeay 0.9.0b 29-Jun-1998";
DH *DH_new()
{
diff --git a/crypto/dh/dhtest.c b/crypto/dh/dhtest.c
index b338715..488f10f 100644
--- a/crypto/dh/dhtest.c
+++ b/crypto/dh/dhtest.c
@@ -1,5 +1,5 @@
/* crypto/dh/dhtest.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -59,8 +59,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef WIN16
-#define APPS_WIN16
+#ifdef WINDOWS
+#include "../bio/bss_file.c"
#endif
#include "crypto.h"
#include "bio.h"
@@ -74,14 +74,14 @@
#endif
#ifndef NOPROTO
-static void MS_CALLBACK cb(int p, int n);
+static void MS_CALLBACK cb(int p, int n, char *arg);
#else
static void MS_CALLBACK cb();
#endif
-#ifdef WIN16
+#ifdef NO_STDIO
#define APPS_WIN16
-#include "../bio/bss_file.c"
+#include "bss_file.c"
#endif
BIO *out=NULL;
@@ -103,7 +103,7 @@ char *argv[];
if (out == NULL) exit(1);
BIO_set_fp(out,stdout,BIO_NOCLOSE);
- a=DH_generate_parameters(64,DH_GENERATOR_5,cb);
+ a=DH_generate_parameters(64,DH_GENERATOR_5,cb,(char *)out);
if (a == NULL) goto err;
BIO_puts(out,"\np =");
@@ -170,9 +170,10 @@ err:
return(ret);
}
-static void MS_CALLBACK cb(p, n)
+static void MS_CALLBACK cb(p, n,arg)
int p;
int n;
+char *arg;
{
char c='*';
@@ -180,7 +181,7 @@ int n;
if (p == 1) c='+';
if (p == 2) c='*';
if (p == 3) c='\n';
- BIO_write(out,&c,1);
+ BIO_write((BIO *)arg,&c,1);
#ifdef LINT
p=n;
#endif
diff --git a/crypto/dh/p1024.c b/crypto/dh/p1024.c
index 7f8cd56..0c50c24 100644
--- a/crypto/dh/p1024.c
+++ b/crypto/dh/p1024.c
@@ -1,5 +1,5 @@
/* crypto/dh/p1024.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/crypto/dh/p192.c b/crypto/dh/p192.c
index c96972c..8819081 100644
--- a/crypto/dh/p192.c
+++ b/crypto/dh/p192.c
@@ -1,5 +1,5 @@
/* crypto/dh/p192.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/crypto/dh/p512.c b/crypto/dh/p512.c
index 6105612..cc84e8e 100644
--- a/crypto/dh/p512.c
+++ b/crypto/dh/p512.c
@@ -1,5 +1,5 @@
/* crypto/dh/p512.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written