auto import from //branches/cupcake/...@126645
diff --git a/README.android b/README.android
index 16e9f2d..cf4fbe7 100644
--- a/README.android
+++ b/README.android
@@ -1,3 +1,13 @@
+Version Information
+---
+
+The code in this directory is based on 0.9.8h with patches from
+http://openssl.org/news/secadv_20090107.txt.
+
+
+Porting New Versions of OpenSSL
+---
+
 The following steps are recommended for porting new OpenSSL versions.
 
 
diff --git a/apps/speed.c b/apps/speed.c
index fd68098..65b8483 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -2134,7 +2134,7 @@
 				{
 				ret=RSA_verify(NID_md5_sha1, buf,36, buf2,
 					rsa_num, rsa_key[j]);
-				if (ret == 0)
+				if (ret <= 0)
 					{
 					BIO_printf(bio_err,
 						"RSA verify failure\n");
diff --git a/apps/spkac.c b/apps/spkac.c
index 0191d0a..01fe406 100644
--- a/apps/spkac.c
+++ b/apps/spkac.c
@@ -285,7 +285,7 @@
 	pkey = NETSCAPE_SPKI_get_pubkey(spki);
 	if(verify) {
 		i = NETSCAPE_SPKI_verify(spki, pkey);
-		if(i) BIO_printf(bio_err, "Signature OK\n");
+		if (i > 0) BIO_printf(bio_err, "Signature OK\n");
 		else {
 			BIO_printf(bio_err, "Signature Failure\n");
 			ERR_print_errors(bio_err);
diff --git a/apps/verify.c b/apps/verify.c
index 9ff32cb..20cc9e3 100644
--- a/apps/verify.c
+++ b/apps/verify.c
@@ -266,7 +266,7 @@
 
 	ret=0;
 end:
-	if (i)
+	if (i > 0)
 		{
 		fprintf(stdout,"OK\n");
 		ret=1;
@@ -367,4 +367,3 @@
 		ERR_clear_error();
 	return(ok);
 	}
-
diff --git a/apps/x509.c b/apps/x509.c
index f693835..d904d34 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -1151,7 +1151,7 @@
 	/* NOTE: this certificate can/should be self signed, unless it was
 	 * a certificate request in which case it is not. */
 	X509_STORE_CTX_set_cert(&xsc,x);
-	if (!reqfile && !X509_verify_cert(&xsc))
+	if (!reqfile && X509_verify_cert(&xsc) <= 0)
 		goto end;
 
 	if (!X509_check_private_key(xca,pkey))
diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c
index e2a90a3..782129c 100644
--- a/ssl/s2_clnt.c
+++ b/ssl/s2_clnt.c
@@ -1044,7 +1044,7 @@
 
 	i=ssl_verify_cert_chain(s,sk);
 		
-	if ((s->verify_mode != SSL_VERIFY_NONE) && (!i))
+	if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0))
 		{
 		SSLerr(SSL_F_SSL2_SET_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED);
 		goto err;
diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c
index 0daf2b1..50d55e6 100644
--- a/ssl/s2_srvr.c
+++ b/ssl/s2_srvr.c
@@ -1054,7 +1054,7 @@
 
 	i=ssl_verify_cert_chain(s,sk);
 
-	if (i)	/* we like the packet, now check the chksum */
+	if (i > 0)	/* we like the packet, now check the chksum */
 		{
 		EVP_MD_CTX ctx;
 		EVP_PKEY *pkey=NULL;
@@ -1083,7 +1083,7 @@
 		EVP_PKEY_free(pkey);
 		EVP_MD_CTX_cleanup(&ctx);
 
-		if (i) 
+		if (i > 0)
 			{
 			if (s->session->peer != NULL)
 				X509_free(s->session->peer);
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index f6864cd..81ae11b 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -965,7 +965,7 @@
 		}
 
 	i=ssl_verify_cert_chain(s,sk);
-	if ((s->verify_mode != SSL_VERIFY_NONE) && (!i)
+	if ((s->verify_mode != SSL_VERIFY_NONE) && (i <= 0)
 #ifndef OPENSSL_NO_KRB5
 	        && (s->s3->tmp.new_cipher->algorithms & (SSL_MKEY_MASK|SSL_AUTH_MASK))
 	        != (SSL_aKRB5|SSL_kKRB5)
@@ -1450,7 +1450,7 @@
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
 			EVP_VerifyUpdate(&md_ctx,param,param_len);
-			if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
+			if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
 				{
 				/* bad signature */
 				al=SSL_AD_DECRYPT_ERROR;
@@ -1468,7 +1468,7 @@
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
 			EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
 			EVP_VerifyUpdate(&md_ctx,param,param_len);
-			if (!EVP_VerifyFinal(&md_ctx,p,(int)n,pkey))
+			if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0)
 				{
 				/* bad signature */
 				al=SSL_AD_DECRYPT_ERROR;
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index 903522a..c0c62b3 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -2558,7 +2558,7 @@
 	else
 		{
 		i=ssl_verify_cert_chain(s,sk);
-		if (!i)
+		if (i <= 0)
 			{
 			al=ssl_verify_alarm_type(s->verify_result);
 			SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE,SSL_R_NO_CERTIFICATE_RETURNED);
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 517657c..41dafbb 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -2072,7 +2072,7 @@
 
 	if (cb_arg->proxy_auth)
 		{
-		if (ok)
+		if (ok > 0)
 			{
 			const char *cond_end = NULL;