|
|
3deda94 |
diff -up openssl-0.9.8g/apps/speed.c.verifysig openssl-0.9.8g/apps/speed.c
|
|
|
3deda94 |
--- openssl-0.9.8g/apps/speed.c.verifysig 2009-01-07 16:09:11.000000000 +0100
|
|
|
3deda94 |
+++ openssl-0.9.8g/apps/speed.c 2009-01-07 16:11:13.000000000 +0100
|
|
|
3deda94 |
@@ -2132,7 +2132,7 @@ int MAIN(int argc, char **argv)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
|
|
|
3deda94 |
rsa_num, rsa_key[j]);
|
|
|
3deda94 |
- if (ret == 0)
|
|
|
3deda94 |
+ if (ret <= 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
BIO_printf(bio_err,
|
|
|
3deda94 |
"RSA verify failure\n");
|
|
|
3deda94 |
diff -up openssl-0.9.8g/apps/verify.c.verifysig openssl-0.9.8g/apps/verify.c
|
|
|
3deda94 |
--- openssl-0.9.8g/apps/verify.c.verifysig 2004-11-29 12:28:07.000000000 +0100
|
|
|
3deda94 |
+++ openssl-0.9.8g/apps/verify.c 2009-01-07 16:11:13.000000000 +0100
|
|
|
3deda94 |
@@ -266,7 +266,7 @@ static int check(X509_STORE *ctx, char *
|
|
|
3deda94 |
|
|
|
3deda94 |
ret=0;
|
|
|
3deda94 |
end:
|
|
|
3deda94 |
- if (i)
|
|
|
3deda94 |
+ if (i > 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
fprintf(stdout,"OK\n");
|
|
|
3deda94 |
ret=1;
|
|
|
3deda94 |
@@ -367,4 +367,3 @@ static int MS_CALLBACK cb(int ok, X509_S
|
|
|
3deda94 |
ERR_clear_error();
|
|
|
3deda94 |
return(ok);
|
|
|
3deda94 |
}
|
|
|
3deda94 |
-
|
|
|
3deda94 |
diff -up openssl-0.9.8g/apps/spkac.c.verifysig openssl-0.9.8g/apps/spkac.c
|
|
|
3deda94 |
--- openssl-0.9.8g/apps/spkac.c.verifysig 2005-04-05 21:11:18.000000000 +0200
|
|
|
3deda94 |
+++ openssl-0.9.8g/apps/spkac.c 2009-01-07 16:11:13.000000000 +0100
|
|
|
3deda94 |
@@ -285,7 +285,7 @@ bad:
|
|
|
3deda94 |
pkey = NETSCAPE_SPKI_get_pubkey(spki);
|
|
|
3deda94 |
if(verify) {
|
|
|
3deda94 |
i = NETSCAPE_SPKI_verify(spki, pkey);
|
|
|
3deda94 |
- if(i) BIO_printf(bio_err, "Signature OK\n");
|
|
|
3deda94 |
+ if (i > 0) BIO_printf(bio_err, "Signature OK\n");
|
|
|
3deda94 |
else {
|
|
|
3deda94 |
BIO_printf(bio_err, "Signature Failure\n");
|
|
|
3deda94 |
ERR_print_errors(bio_err);
|
|
|
3deda94 |
diff -up openssl-0.9.8g/apps/x509.c.verifysig openssl-0.9.8g/apps/x509.c
|
|
|
3deda94 |
--- openssl-0.9.8g/apps/x509.c.verifysig 2005-07-16 13:13:03.000000000 +0200
|
|
|
3deda94 |
+++ openssl-0.9.8g/apps/x509.c 2009-01-07 16:11:13.000000000 +0100
|
|
|
3deda94 |
@@ -1144,7 +1144,7 @@ static int x509_certify(X509_STORE *ctx,
|
|
|
3deda94 |
/* NOTE: this certificate can/should be self signed, unless it was
|
|
|
3deda94 |
* a certificate request in which case it is not. */
|
|
|
3deda94 |
X509_STORE_CTX_set_cert(&xsc,x);
|
|
|
3deda94 |
- if (!reqfile && !X509_verify_cert(&xsc))
|
|
|
3deda94 |
+ if (!reqfile && X509_verify_cert(&xsc) <= 0)
|
|
|
3deda94 |
goto end;
|
|
|
3deda94 |
|
|
|
3deda94 |
if (!X509_check_private_key(xca,pkey))
|
|
|
3deda94 |
diff -up openssl-0.9.8g/ssl/s2_clnt.c.verifysig openssl-0.9.8g/ssl/s2_clnt.c
|
|
|
3deda94 |
--- openssl-0.9.8g/ssl/s2_clnt.c.verifysig 2007-09-06 14:43:53.000000000 +0200
|
|
|
3deda94 |
+++ openssl-0.9.8g/ssl/s2_clnt.c 2009-01-07 16:11:32.000000000 +0100
|
|
|
3deda94 |
@@ -1044,7 +1044,7 @@ int ssl2_set_certificate(SSL *s, int typ
|
|
|
3deda94 |
|
|
|
3deda94 |
i=ssl_verify_cert_chain(s,sk);
|
|
|
3deda94 |
|
|
|
3deda94 |
- if ((s->verify_mode != SSL_VERIFY_NONE) && (!i))
|
|
|
3deda94 |
+ if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0))
|
|
|
3deda94 |
{
|
|
|
3deda94 |
SSLerr(SSL_F_SSL2_SET_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED);
|
|
|
3deda94 |
goto err;
|
|
|
3deda94 |
diff -up openssl-0.9.8g/ssl/s2_srvr.c.verifysig openssl-0.9.8g/ssl/s2_srvr.c
|
|
|
3deda94 |
--- openssl-0.9.8g/ssl/s2_srvr.c.verifysig 2007-09-06 14:43:53.000000000 +0200
|
|
|
3deda94 |
+++ openssl-0.9.8g/ssl/s2_srvr.c 2009-01-07 16:12:54.000000000 +0100
|
|
|
3deda94 |
@@ -1054,7 +1054,7 @@ static int request_certificate(SSL *s)
|
|
|
3deda94 |
|
|
|
3deda94 |
i=ssl_verify_cert_chain(s,sk);
|
|
|
3deda94 |
|
|
|
3deda94 |
- if (i) /* we like the packet, now check the chksum */
|
|
|
3deda94 |
+ if (i > 0) /* we like the packet, now check the chksum */
|
|
|
3deda94 |
{
|
|
|
3deda94 |
EVP_MD_CTX ctx;
|
|
|
3deda94 |
EVP_PKEY *pkey=NULL;
|
|
|
3deda94 |
@@ -1083,7 +1083,7 @@ static int request_certificate(SSL *s)
|
|
|
3deda94 |
EVP_PKEY_free(pkey);
|
|
|
3deda94 |
EVP_MD_CTX_cleanup(&ctx;;
|
|
|
3deda94 |
|
|
|
3deda94 |
- if (i)
|
|
|
3deda94 |
+ if (i > 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
if (s->session->peer != NULL)
|
|
|
3deda94 |
X509_free(s->session->peer);
|
|
|
3deda94 |
diff -up openssl-0.9.8g/ssl/s3_clnt.c.verifysig openssl-0.9.8g/ssl/s3_clnt.c
|
|
|
3deda94 |
--- openssl-0.9.8g/ssl/s3_clnt.c.verifysig 2009-01-07 16:09:11.000000000 +0100
|
|
|
3deda94 |
+++ openssl-0.9.8g/ssl/s3_clnt.c 2009-01-07 16:11:32.000000000 +0100
|
|
|
3deda94 |
@@ -940,7 +940,7 @@ int ssl3_get_server_certificate(SSL *s)
|
|
|
3deda94 |
}
|
|
|
3deda94 |
|
|
|
3deda94 |
i=ssl_verify_cert_chain(s,sk);
|
|
|
3deda94 |
- if ((s->verify_mode != SSL_VERIFY_NONE) && (!i)
|
|
|
3deda94 |
+ if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0)
|
|
|
3deda94 |
#ifndef OPENSSL_NO_KRB5
|
|
|
3deda94 |
&& (s->s3->tmp.new_cipher->algorithms & (SSL_MKEY_MASK|SSL_AUTH_MASK))
|
|
|
3deda94 |
!= (SSL_aKRB5|SSL_kKRB5)
|
|
|
3deda94 |
@@ -1425,7 +1425,7 @@ int ssl3_get_key_exchange(SSL *s)
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,param,param_len);
|
|
|
3deda94 |
- if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
|
|
|
3deda94 |
+ if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
/* bad signature */
|
|
|
3deda94 |
al=SSL_AD_DECRYPT_ERROR;
|
|
|
3deda94 |
@@ -1443,7 +1443,7 @@ int ssl3_get_key_exchange(SSL *s)
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
|
|
|
3deda94 |
EVP_VerifyUpdate(&md_ctx,param,param_len);
|
|
|
3deda94 |
- if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
|
|
|
3deda94 |
+ if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
/* bad signature */
|
|
|
3deda94 |
al=SSL_AD_DECRYPT_ERROR;
|
|
|
3deda94 |
diff -up openssl-0.9.8g/ssl/ssltest.c.verifysig openssl-0.9.8g/ssl/ssltest.c
|
|
|
3deda94 |
--- openssl-0.9.8g/ssl/ssltest.c.verifysig 2009-01-07 16:09:11.000000000 +0100
|
|
|
3deda94 |
+++ openssl-0.9.8g/ssl/ssltest.c 2009-01-07 16:11:32.000000000 +0100
|
|
|
3deda94 |
@@ -2061,7 +2061,7 @@ static int MS_CALLBACK app_verify_callba
|
|
|
3deda94 |
|
|
|
3deda94 |
if (cb_arg->proxy_auth)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
- if (ok)
|
|
|
3deda94 |
+ if (ok > 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
const char *cond_end = NULL;
|
|
|
3deda94 |
|
|
|
3deda94 |
diff -up openssl-0.9.8g/ssl/s3_srvr.c.verifysig openssl-0.9.8g/ssl/s3_srvr.c
|
|
|
3deda94 |
--- openssl-0.9.8g/ssl/s3_srvr.c.verifysig 2007-09-30 20:55:59.000000000 +0200
|
|
|
3deda94 |
+++ openssl-0.9.8g/ssl/s3_srvr.c 2009-01-07 16:11:32.000000000 +0100
|
|
|
3deda94 |
@@ -2519,7 +2519,7 @@ int ssl3_get_client_certificate(SSL *s)
|
|
|
3deda94 |
else
|
|
|
3deda94 |
{
|
|
|
3deda94 |
i=ssl_verify_cert_chain(s,sk);
|
|
|
3deda94 |
- if (!i)
|
|
|
3deda94 |
+ if (i <= 0)
|
|
|
3deda94 |
{
|
|
|
3deda94 |
al=ssl_verify_alarm_type(s->verify_result);
|
|
|
3deda94 |
SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE,SSL_R_NO_CERTIFICATE_RETURNED);
|