pajoye Sun Jul 30 09:18:23 2006 UTC Modified files: /php-src/ext/openssl openssl.c Log: - MFB: silent compiler warnins (signess) http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.111&r2=1.112&diff_format=u Index: php-src/ext/openssl/openssl.c diff -u php-src/ext/openssl/openssl.c:1.111 php-src/ext/openssl/openssl.c:1.112 --- php-src/ext/openssl/openssl.c:1.111 Sun Jul 30 08:28:48 2006 +++ php-src/ext/openssl/openssl.c Sun Jul 30 09:18:23 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: openssl.c,v 1.111 2006/07/30 08:28:48 pajoye Exp $ */ +/* $Id: openssl.c,v 1.112 2006/07/30 09:18:23 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -254,7 +254,7 @@ obj_cnt++; ne = X509_NAME_get_entry(name, j); str = X509_NAME_ENTRY_get_data(ne); - add_next_index_stringl(subentries, str->data, str->length, 1); + add_next_index_stringl(subentries, (char *)str->data, str->length, 1); } last = j; } @@ -266,7 +266,7 @@ zval_dtor(subentries); FREE_ZVAL(subentries); if (obj_cnt) { - add_assoc_stringl(subitem, sname, str->data, str->length, 1); + add_assoc_stringl(subitem, sname, (char *)str->data, str->length, 1); } } } @@ -276,7 +276,7 @@ static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /* {{{ */ { - add_assoc_stringl(val, key, str->data, str->length, 1); + add_assoc_stringl(val, key, (char *)str->data, str->length, 1); } /* }}} */ @@ -300,7 +300,7 @@ return (time_t)-1; } - strbuf = estrdup(timestr->data); + strbuf = estrdup((char *)timestr->data); memset(&thetime, 0, sizeof(thetime)); @@ -968,7 +968,7 @@ add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert) TSRMLS_CC)); add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert) TSRMLS_CC)); - tmpstr = X509_alias_get0(cert, NULL); + tmpstr = (char *)X509_alias_get0(cert, NULL); if (tmpstr) { add_assoc_string(return_value, "alias", tmpstr, 1); } @@ -1285,8 +1285,8 @@ zend_hash_internal_pointer_reset_ex(HASH_OF(dn), &hpos); while(zend_hash_get_current_data_ex(HASH_OF(dn), (void**)&item, &hpos) == SUCCESS) { zstr strindex; - int strindexlen; - long intindex; + uint strindexlen; + ulong intindex; zend_hash_get_current_key_ex(HASH_OF(dn), &strindex, &strindexlen, &intindex, 0, &hpos); @@ -1360,8 +1360,8 @@ zend_hash_internal_pointer_reset_ex(HASH_OF(attribs), &hpos); while(zend_hash_get_current_data_ex(HASH_OF(attribs), (void**)&item, &hpos) == SUCCESS) { zstr strindex; - int strindexlen; - long intindex; + uint strindexlen; + ulong intindex; zend_hash_get_current_key_ex(HASH_OF(attribs), &strindex, &strindexlen, &intindex, 0, &hpos); convert_to_string_ex(item); @@ -2053,7 +2053,7 @@ } else { cipher = NULL; } - if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) { + if (PEM_write_bio_PrivateKey(bio_out, key, cipher,(unsigned char *)passphrase, passphrase_len, NULL, NULL)) { /* Success! * If returning the output as a string, do so now */ RETVAL_TRUE; @@ -2104,7 +2104,7 @@ } else { cipher = NULL; } - if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) { + if (PEM_write_bio_PrivateKey(bio_out, key, cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL)) { /* Success! * If returning the output as a string, do so now */ @@ -2664,7 +2664,7 @@ case EVP_PKEY_RSA: case EVP_PKEY_RSA2: successful = (RSA_private_encrypt(data_len, - data, + (unsigned char *)data, cryptedbuf, pkey->pkey.rsa, padding) == cryptedlen); @@ -2676,7 +2676,7 @@ if (successful) { zval_dtor(crypted); cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); + ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0); cryptedbuf = NULL; RETVAL_TRUE; } @@ -2722,7 +2722,7 @@ case EVP_PKEY_RSA: case EVP_PKEY_RSA2: cryptedlen = RSA_private_decrypt(data_len, - data, + (char *)data, crypttemp, pkey->pkey.rsa, padding); @@ -2741,7 +2741,7 @@ if (successful) { zval_dtor(crypted); cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); + ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0); cryptedbuf = NULL; RETVAL_TRUE; } @@ -2787,7 +2787,7 @@ case EVP_PKEY_RSA: case EVP_PKEY_RSA2: successful = (RSA_public_encrypt(data_len, - data, + (unsigned char *)data, cryptedbuf, pkey->pkey.rsa, padding) == cryptedlen); @@ -2800,7 +2800,7 @@ if (successful) { zval_dtor(crypted); cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); + ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0); cryptedbuf = NULL; RETVAL_TRUE; } @@ -2846,7 +2846,7 @@ case EVP_PKEY_RSA: case EVP_PKEY_RSA2: cryptedlen = RSA_public_decrypt(data_len, - data, + (unsigned char *)data, crypttemp, pkey->pkey.rsa, padding); @@ -2867,7 +2867,7 @@ if (successful) { zval_dtor(crypted); cryptedbuf[cryptedlen] = '\0'; - ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0); + ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0); cryptedbuf = NULL; RETVAL_TRUE; } @@ -2936,10 +2936,10 @@ EVP_SignInit(&md_ctx, mdtype); EVP_SignUpdate(&md_ctx, data, data_len); - if (EVP_SignFinal (&md_ctx, sigbuf, &siglen, pkey)) { + if (EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *) &siglen, pkey)) { zval_dtor(signature); sigbuf[siglen] = '\0'; - ZVAL_STRINGL(signature, sigbuf, siglen, 0); + ZVAL_STRINGL(signature, (char *)sigbuf, siglen, 0); RETVAL_TRUE; } else { efree(sigbuf); @@ -2983,7 +2983,7 @@ EVP_VerifyInit (&md_ctx, mdtype); EVP_VerifyUpdate (&md_ctx, data, data_len); - err = EVP_VerifyFinal (&md_ctx, signature, signature_len, pkey); + err = EVP_VerifyFinal (&md_ctx, (unsigned char *)signature, signature_len, pkey); if (keyresource == -1) { EVP_PKEY_free(pkey); @@ -3051,7 +3051,7 @@ /* allocate one byte extra to make room for \0 */ buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx)); - if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, data, data_len)) { + if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) { RETVAL_FALSE; efree(buf); goto clean_exit; @@ -3063,7 +3063,7 @@ zval_dtor(sealdata); buf[len1 + len2] = '\0'; buf = erealloc(buf, len1 + len2 + 1); - ZVAL_STRINGL(sealdata, buf, len1 + len2, 0); + ZVAL_STRINGL(sealdata, (char *)buf, len1 + len2, 0); zval_dtor(ekeys); array_init(ekeys); @@ -3127,7 +3127,7 @@ } buf = emalloc(data_len + 1); - if (EVP_OpenInit(&ctx, EVP_rc4(), ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx, buf, &len1, data, data_len)) { + if (EVP_OpenInit(&ctx, EVP_rc4(), (unsigned char *)ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) { if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || (len1 + len2 == 0)) { efree(buf); if (keyresource == -1) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php