summaryrefslogtreecommitdiffstats
path: root/crypto/openssl
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-05-20 03:17:35 +0000
committerkris <kris@FreeBSD.org>2001-05-20 03:17:35 +0000
commit445c7928a166ddd374f98189e149d7e27092573e (patch)
tree4127aa35b669d1fef973314beb69f8303022eb16 /crypto/openssl
parent8acf08a7904cd7fbf506f79a905bb8e29164019a (diff)
downloadFreeBSD-src-445c7928a166ddd374f98189e149d7e27092573e.zip
FreeBSD-src-445c7928a166ddd374f98189e149d7e27092573e.tar.gz
Resolve conflicts
Diffstat (limited to 'crypto/openssl')
-rw-r--r--crypto/openssl/apps/speed.c4
-rw-r--r--crypto/openssl/crypto/des/des.h8
-rw-r--r--crypto/openssl/crypto/rsa/rsa_eay.c12
-rw-r--r--crypto/openssl/crypto/rsa/rsa_lib.c10
-rw-r--r--crypto/openssl/ssl/s23_lib.c38
-rw-r--r--crypto/openssl/ssl/s2_pkt.c2
6 files changed, 48 insertions, 26 deletions
diff --git a/crypto/openssl/apps/speed.c b/crypto/openssl/apps/speed.c
index 156d19f..4a42aeb 100644
--- a/crypto/openssl/apps/speed.c
+++ b/crypto/openssl/apps/speed.c
@@ -833,6 +833,7 @@ int MAIN(int argc, char **argv)
}
#endif
+#ifndef NO_DSA
dsa_c[R_DSA_512][0]=count/1000;
dsa_c[R_DSA_512][1]=count/1000/2;
for (i=1; i<DSA_NUM; i++)
@@ -850,6 +851,7 @@ int MAIN(int argc, char **argv)
}
}
}
+#endif
#define COND(d) (count < (d))
#define COUNT(d) (d)
@@ -1175,7 +1177,7 @@ int MAIN(int argc, char **argv)
{
BIO_printf(bio_err,"RSA verify failure. No RSA verify will be done.\n");
ERR_print_errors(bio_err);
- dsa_doit[j] = 0;
+ rsa_doit[j] = 0;
}
else
{
diff --git a/crypto/openssl/crypto/des/des.h b/crypto/openssl/crypto/des/des.h
index 502d5c1..6207e08 100644
--- a/crypto/openssl/crypto/des/des.h
+++ b/crypto/openssl/crypto/des/des.h
@@ -148,14 +148,14 @@ void des_ecb_encrypt(const_des_cblock *input,des_cblock *output,
Data is a pointer to 2 unsigned long's and ks is the
des_key_schedule to use. enc, is non zero specifies encryption,
zero if decryption. */
-void des_encrypt(DES_LONG *data,des_key_schedule ks, int enc);
+void des_encrypt1(DES_LONG *data,des_key_schedule ks, int enc);
-/* This functions is the same as des_encrypt() except that the DES
+/* This functions is the same as des_encrypt1() except that the DES
initial permutation (IP) and final permutation (FP) have been left
- out. As for des_encrypt(), you should not use this function.
+ out. As for des_encrypt1(), you should not use this function.
It is used by the routines in the library that implement triple DES.
IP() des_encrypt2() des_encrypt2() des_encrypt2() FP() is the same
- as des_encrypt() des_encrypt() des_encrypt() except faster :-). */
+ as des_encrypt1() des_encrypt1() des_encrypt1() except faster :-). */
void des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc);
void des_encrypt3(DES_LONG *data, des_key_schedule ks1,
diff --git a/crypto/openssl/crypto/rsa/rsa_eay.c b/crypto/openssl/crypto/rsa/rsa_eay.c
index d9b4fbb..90771dc 100644
--- a/crypto/openssl/crypto/rsa/rsa_eay.c
+++ b/crypto/openssl/crypto/rsa/rsa_eay.c
@@ -444,13 +444,14 @@ err:
static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
{
- BIGNUM r1,m1;
+ BIGNUM r1,m1,vrfy;
int ret=0;
BN_CTX *ctx;
if ((ctx=BN_CTX_new()) == NULL) goto err;
BN_init(&m1);
BN_init(&r1);
+ BN_init(&vrfy);
if (rsa->flags & RSA_FLAG_CACHE_PRIVATE)
{
@@ -531,10 +532,19 @@ static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
if (!BN_mul(&r1,r0,rsa->q,ctx)) goto err;
if (!BN_add(r0,&r1,&m1)) goto err;
+ if (rsa->e && rsa->n)
+ {
+ if (!rsa->meth->bn_mod_exp(&vrfy,r0,rsa->e,rsa->n,ctx,NULL)) goto err;
+ if (BN_cmp(I, &vrfy) != 0)
+ {
+ if (!rsa->meth->bn_mod_exp(r0,I,rsa->d,rsa->n,ctx,NULL)) goto err;
+ }
+ }
ret=1;
err:
BN_clear_free(&m1);
BN_clear_free(&r1);
+ BN_clear_free(&vrfy);
BN_CTX_free(ctx);
return(ret);
}
diff --git a/crypto/openssl/crypto/rsa/rsa_lib.c b/crypto/openssl/crypto/rsa/rsa_lib.c
index f5d1770..5220f5f 100644
--- a/crypto/openssl/crypto/rsa/rsa_lib.c
+++ b/crypto/openssl/crypto/rsa/rsa_lib.c
@@ -146,13 +146,13 @@ RSA *RSA_new_method(RSA_METHOD *meth)
ret->blinding=NULL;
ret->bignum_data=NULL;
ret->flags=ret->meth->flags;
+ CRYPTO_new_ex_data(rsa_meth,ret,&ret->ex_data);
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
+ CRYPTO_free_ex_data(rsa_meth,ret,&ret->ex_data);
OPENSSL_free(ret);
ret=NULL;
}
- else
- CRYPTO_new_ex_data(rsa_meth,ret,&ret->ex_data);
return(ret);
}
@@ -175,11 +175,11 @@ void RSA_free(RSA *r)
}
#endif
- CRYPTO_free_ex_data(rsa_meth,r,&r->ex_data);
-
if (r->meth->finish != NULL)
r->meth->finish(r);
+ CRYPTO_free_ex_data(rsa_meth,r,&r->ex_data);
+
if (r->n != NULL) BN_clear_free(r->n);
if (r->e != NULL) BN_clear_free(r->e);
if (r->d != NULL) BN_clear_free(r->d);
@@ -273,7 +273,7 @@ int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx)
BN_CTX_start(ctx);
A = BN_CTX_get(ctx);
- if (!BN_rand(A,BN_num_bits(rsa->n)-1,1,0)) goto err;
+ if (!BN_rand_range(A,rsa->n)) goto err;
if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err;
if (!rsa->meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n))
diff --git a/crypto/openssl/ssl/s23_lib.c b/crypto/openssl/ssl/s23_lib.c
index bc77e84..fe7e2d1 100644
--- a/crypto/openssl/ssl/s23_lib.c
+++ b/crypto/openssl/ssl/s23_lib.c
@@ -65,6 +65,7 @@
static int ssl23_num_ciphers(void );
static SSL_CIPHER *ssl23_get_cipher(unsigned int u);
static int ssl23_read(SSL *s, void *buf, int len);
+static int ssl23_peek(SSL *s, void *buf, int len);
static int ssl23_write(SSL *s, const void *buf, int len);
static long ssl23_default_timeout(void );
static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p);
@@ -79,7 +80,7 @@ static SSL_METHOD SSLv23_data= {
ssl_undefined_function,
ssl_undefined_function,
ssl23_read,
- (int (*)(struct ssl_st *, char *, int))ssl_undefined_function,
+ ssl23_peek,
ssl23_write,
ssl_undefined_function,
ssl_undefined_function,
@@ -171,13 +172,6 @@ static int ssl23_read(SSL *s, void *buf, int len)
{
int n;
-#if 0
- if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
- {
- s->rwstate=SSL_NOTHING;
- return(0);
- }
-#endif
clear_sys_error();
if (SSL_in_init(s) && (!s->in_handshake))
{
@@ -197,17 +191,33 @@ static int ssl23_read(SSL *s, void *buf, int len)
}
}
-static int ssl23_write(SSL *s, const void *buf, int len)
+static int ssl23_peek(SSL *s, void *buf, int len)
{
int n;
-#if 0
- if (s->shutdown & SSL_SENT_SHUTDOWN)
+ clear_sys_error();
+ if (SSL_in_init(s) && (!s->in_handshake))
+ {
+ n=s->handshake_func(s);
+ if (n < 0) return(n);
+ if (n == 0)
+ {
+ SSLerr(SSL_F_SSL23_PEEK,SSL_R_SSL_HANDSHAKE_FAILURE);
+ return(-1);
+ }
+ return(SSL_peek(s,buf,len));
+ }
+ else
{
- s->rwstate=SSL_NOTHING;
- return(0);
+ ssl_undefined_function(s);
+ return(-1);
}
-#endif
+ }
+
+static int ssl23_write(SSL *s, const void *buf, int len)
+ {
+ int n;
+
clear_sys_error();
if (SSL_in_init(s) && (!s->in_handshake))
{
diff --git a/crypto/openssl/ssl/s2_pkt.c b/crypto/openssl/ssl/s2_pkt.c
index 4e752a2..6e37903 100644
--- a/crypto/openssl/ssl/s2_pkt.c
+++ b/crypto/openssl/ssl/s2_pkt.c
@@ -301,7 +301,7 @@ int ssl2_read(SSL *s, void *buf, int len)
return ssl2_read_internal(s, buf, len, 0);
}
-int ssl2_peek(SSL *s, char *buf, int len)
+int ssl2_peek(SSL *s, void *buf, int len)
{
return ssl2_read_internal(s, buf, len, 1);
}
OpenPOWER on IntegriCloud