com php-src: zero sensitive data more secure way: ext/standard/crypt.c
| From: | Anatol Belski | Date: | Thu, 18 Sep 2014 22:06:34 +0000 |
| Subject: | com php-src: zero sensitive data more secure way: ext/standard/crypt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81749@lists.php.net to get a copy of this message | ||
Commit: 2b77a57d884fab11dd54da0d78cb16a0496e76b4
Author: Anatol Belski <ab@php.net> Thu, 18 Sep 2014 22:02:04 +0200
Parents: 3fa506417329c93ed47c1e79a03335b54d6838b6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2b77a57d884fab11dd54da0d78cb16a0496e76b4
Log:
zero sensitive data more secure way
Changed paths:
M ext/standard/crypt.c
Diff:
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 1a9acf5..b2524a0 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -211,7 +211,11 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const
ch
return NULL;
} else {
result = zend_string_init(output, strlen(output), 0);
+#ifdef PHP_WIN32
+ RtlSecureZeroMemory(output, PHP_MAX_SALT_LEN + 1);
+#else
memset(output, 0, PHP_MAX_SALT_LEN + 1);
+#endif
return result;
}
} else {