diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-05-10 21:05:14 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-05-10 21:05:14 +0000 |
| commit | 51e0891f0ba5828233e418b8e04ea5d7b33482e8 (patch) | |
| tree | 73cafcdebe05efcd54e95159fea4fc24f9d37c13 | |
| parent | 63c11738f8efe8dc6a3fc2719df105eaafb98f0f (diff) | |
| download | php-git-51e0891f0ba5828233e418b8e04ea5d7b33482e8.tar.gz | |
Fixed random number generation for http auth mechanism in SOAP
# Identified by Stefan Esser
| -rw-r--r-- | ext/soap/php_http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 0d27bb591b..b487772556 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -22,6 +22,7 @@ #include "php_soap.h" #include "ext/standard/base64.h" #include "ext/standard/md5.h" +#include "ext/standard/php_rand.h" static char *get_http_header_value(char *headers, char *type); static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC); @@ -469,10 +470,9 @@ try_again: char HA1[33], HA2[33], response[33], cnonce[33], nc[9]; PHP_MD5_CTX md5ctx; unsigned char hash[16]; - unsigned int ctx; PHP_MD5Init(&md5ctx); - snprintf(cnonce, sizeof(cnonce), "%d", php_rand_r(&ctx)); + snprintf(cnonce, sizeof(cnonce), "%d", php_rand(TSRMLS_C)); PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce)); PHP_MD5Final(hash, &md5ctx); make_digest(cnonce, hash); |
