summaryrefslogtreecommitdiff
path: root/ext/standard/php_crypt_r.h
diff options
context:
space:
mode:
authorAlex Dowad <alexinbeijing@gmail.com>2020-06-23 16:32:41 +0200
committerAlex Dowad <alexinbeijing@gmail.com>2020-06-24 13:40:27 +0200
commit19d3e29bf5383b5b71b00727bd9bb5971bbbdce5 (patch)
treecee4ee4c8791aeec0c295d5fc6eba529f83ae690 /ext/standard/php_crypt_r.h
parente94afec7007dcd3557a40b020f6f184fa2338cdf (diff)
downloadphp-git-19d3e29bf5383b5b71b00727bd9bb5971bbbdce5.tar.gz
Clean house in cryptographic hashing code
- Remove dead code from php_crypt_r.c This code has been commented out since the file was added in 2008. It's safe to say that no-one is ever going to use it. - Fix typo in comment in php_crypt_r.c - Remove redundant Windows-only implementation of php_md5_crypt_r There is a portable implementation in the same file, which is selected if not building for Windows. But why should Windows have its own special implementation of this function at all? There doesn't seem to be any good reason. Better to use the portable implementation on all platforms. - Don't define useless __CONST macro in php_crypt_r.h This preprocessor macro is not used anywhere. - Add comment on functions for encoding data as Base64 - Remove dead code from crypt_blowfish.h - Remove unneeded junk comments from crypt_freesec.c - Remove dead code from crypt_blowfish.c This function has been commented out since 2011.
Diffstat (limited to 'ext/standard/php_crypt_r.h')
-rw-r--r--ext/standard/php_crypt_r.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h
index 20cf215dfd..8ea5282d82 100644
--- a/ext/standard/php_crypt_r.h
+++ b/ext/standard/php_crypt_r.h
@@ -17,28 +17,14 @@
#ifndef _CRYPT_WIHN32_H_
#define _CRYPT_WIHN32_H_
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+BEGIN_EXTERN_C()
#include "crypt_freesec.h"
-#ifndef __const
-#ifdef __GNUC__
-#define __CONST __const
-#else
-#define __CONST
-#endif
-#else
-#define __CONST __const
-#endif
-
void php_init_crypt_r();
void php_shutdown_crypt_r();
extern void _crypt_extended_init_r(void);
-/*PHPAPI char* crypt(const char *key, const char *salt);*/
PHPAPI char *php_crypt_r (const char *__key, const char *__salt, struct php_crypt_extended_data * __data);
#define MD5_HASH_MAX_LEN 120
@@ -48,9 +34,6 @@ PHPAPI char *php_crypt_r (const char *__key, const char *__salt, struct php_cryp
extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out);
extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
-
-#ifdef __cplusplus
-}
-#endif
+END_EXTERN_C()
#endif /* _CRYPT_WIHN32_H_ */