php-src/ext/standard/php_crypt_r.h
Alex Dowad 19d3e29bf5 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.
2020-06-24 13:40:27 +02:00

40 lines
1.6 KiB
C

/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Pierre Alain Joye <pajoye@php.net |
+----------------------------------------------------------------------+
*/
#ifndef _CRYPT_WIHN32_H_
#define _CRYPT_WIHN32_H_
BEGIN_EXTERN_C()
#include "crypt_freesec.h"
void php_init_crypt_r();
void php_shutdown_crypt_r();
extern void _crypt_extended_init_r(void);
PHPAPI char *php_crypt_r (const char *__key, const char *__salt, struct php_crypt_extended_data * __data);
#define MD5_HASH_MAX_LEN 120
#include "crypt_blowfish.h"
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);
END_EXTERN_C()
#endif /* _CRYPT_WIHN32_H_ */