forked from php/pecl-php-blenc
-
Notifications
You must be signed in to change notification settings - Fork 6
/
php_blenc.h
97 lines (79 loc) · 2.95 KB
/
php_blenc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
+----------------------------------------------------------------------+
| PHP Version 7.4 - 8.2 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2013 The PHP Group |
| Copyright (c) 2022-2023 Tuukka Pasanen |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 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_0.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 |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: John Coggeshall <[email protected]> |
| Giuseppe Chiesa <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_BLENC_H
#define PHP_BLENC_H
#if ZEND_MODULE_API_NO < 20151012
#error "PHP version lower than 7.0 is not supported. Please use older release for PHP 5.6"
#endif
#define PHP_BLENC_VERSION "1.1.4b"
#define BLENC_IDENT "BLENC"
#define BLENC_BUFSIZE 4092
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
extern zend_module_entry blenc_module_entry;
#define phpext_blenc_ptr &blenc_module_entry
#ifdef PHP_WIN32
#define PHP_BLENC_API __declspec(dllexport)
#else
#define PHP_BLENC_API
#endif
#ifdef ZTS
#include "TSRM.h"
#else
#endif
PHP_MINIT_FUNCTION(blenc);
PHP_MSHUTDOWN_FUNCTION(blenc);
PHP_RINIT_FUNCTION(blenc);
PHP_MINFO_FUNCTION(blenc);
PHP_FUNCTION(blenc_encrypt);
typedef unsigned char b_byte;
typedef unsigned int b_uint;
ZEND_BEGIN_MODULE_GLOBALS(blenc)
char *key_file;
char *decoded;
size_t decoded_len;
size_t index;
zend_bool keys_loaded;
zend_bool expired;
char *expire_date;
unsigned long expire_date_numerical;
ZEND_END_MODULE_GLOBALS(blenc)
size_t (*old_stream_reader)(void *, char *, size_t);
void (*old_stream_closer)(void *);
zend_op_array *(*zend_compile_file_old)(zend_file_handle *, int);
zend_op_array *blenc_compile(zend_file_handle *, int);
static void php_blenc_make_md5(char *, void *, size_t);
static char *php_blenc_file_to_mem(char *);
static int php_blenc_load_keyhash();
b_byte *php_blenc_encode(void *, unsigned char *, size_t, size_t *);
b_byte *php_blenc_decode(void *, unsigned char *, size_t, size_t *);
static unsigned char *php_blenc_gen_key();
void _php_blenc_pefree_wrapper(void **);
#ifdef ZTS
#define BL_G(v) TSRMG(blenc_globals_id, zend_blenc_globals *, v)
#else
#define BL_G(v) (blenc_globals.v)
#endif
#endif /* PHP_BLENC_H */