summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/builds.yml1
-rw-r--r--src/php_snuffleupagus.h10
-rw-r--r--src/sp_harden_rand.h2
-rw-r--r--src/tests/session_encryption/set_custom_session_handler.phpt1
-rw-r--r--src/tweetnacl.c1
5 files changed, 12 insertions, 3 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
index 7578bbe..72294f1 100644
--- a/.github/workflows/builds.yml
+++ b/.github/workflows/builds.yml
@@ -11,6 +11,7 @@ jobs:
11 strategy: 11 strategy:
12 matrix: 12 matrix:
13 container: 13 container:
14 - php:8.4-rc
14 - php:8.3 15 - php:8.3
15 - php:8.2 16 - php:8.2
16 - php:8.1 17 - php:8.1
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
index 6e035d4..b4d1be1 100644
--- a/src/php_snuffleupagus.h
+++ b/src/php_snuffleupagus.h
@@ -42,6 +42,7 @@
42#include "ext/standard/php_string.h" 42#include "ext/standard/php_string.h"
43#include "ext/standard/php_var.h" 43#include "ext/standard/php_var.h"
44#include "ext/session/php_session.h" 44#include "ext/session/php_session.h"
45#include "ext/hash/php_hash.h"
45#include "php.h" 46#include "php.h"
46#include "php_ini.h" 47#include "php_ini.h"
47#include "rfc1867.h" 48#include "rfc1867.h"
@@ -58,9 +59,11 @@
58#error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \ 59#error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \
59 since it's not supported anymore: https://secure.php.net/supported-versions.php 60 since it's not supported anymore: https://secure.php.net/supported-versions.php
60#endif 61#endif
62
61#if PHP_VERSION_ID < 70200 63#if PHP_VERSION_ID < 70200
62typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS); 64typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
63#endif 65#endif
66
64#if PHP_VERSION_ID >= 80000 67#if PHP_VERSION_ID >= 80000
65#define TSRMLS_FETCH() 68#define TSRMLS_FETCH()
66#define TSRMLS_C 69#define TSRMLS_C
@@ -70,6 +73,13 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
70#endif 73#endif
71#endif 74#endif
72 75
76#if PHP_VERSION_ID < 80200
77#include "ext/standard/php_rand.h"
78#include "ext/standard/php_random.h"
79#else
80#include "ext/random/php_random.h"
81#endif
82
73#define SP_CONFIG_VALID 1 83#define SP_CONFIG_VALID 1
74#define SP_CONFIG_INVALID 0 84#define SP_CONFIG_INVALID 0
75#define SP_CONFIG_NONE -1 85#define SP_CONFIG_NONE -1
diff --git a/src/sp_harden_rand.h b/src/sp_harden_rand.h
index bbe9be4..0721da0 100644
--- a/src/sp_harden_rand.h
+++ b/src/sp_harden_rand.h
@@ -1,8 +1,6 @@
1#ifndef __SP_HARDEN_RAND_H 1#ifndef __SP_HARDEN_RAND_H
2#define __SP_HARDEN_RAND_H 2#define __SP_HARDEN_RAND_H
3 3
4#include "ext/standard/php_rand.h"
5#include "ext/standard/php_random.h"
6#include "zend_exceptions.h" 4#include "zend_exceptions.h"
7 5
8int hook_rand(void); 6int hook_rand(void);
diff --git a/src/tests/session_encryption/set_custom_session_handler.phpt b/src/tests/session_encryption/set_custom_session_handler.phpt
index 04edcd0..1f3f907 100644
--- a/src/tests/session_encryption/set_custom_session_handler.phpt
+++ b/src/tests/session_encryption/set_custom_session_handler.phpt
@@ -3,6 +3,7 @@ Set a custom session handler
3--SKIPIF-- 3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> 4<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
5<?php if (!extension_loaded("session")) print "skip"; ?> 5<?php if (!extension_loaded("session")) print "skip"; ?>
6<?php if (PHP_VERSION_ID >= 80400) print "skip"; /* Calling session_set_save_handler() with more than 2 arguments is deprecated */ ?>
6--EXTENSIONS-- 7--EXTENSIONS--
7session 8session
8--INI-- 9--INI--
diff --git a/src/tweetnacl.c b/src/tweetnacl.c
index 746cabc..e6d6ed2 100644
--- a/src/tweetnacl.c
+++ b/src/tweetnacl.c
@@ -1,7 +1,6 @@
1/* Since TweetNacl doesn't come with a `randombytes` implementation, 1/* Since TweetNacl doesn't come with a `randombytes` implementation,
2we're using the one from PHP.*/ 2we're using the one from PHP.*/
3#include "php_snuffleupagus.h" 3#include "php_snuffleupagus.h"
4#include "ext/standard/php_random.h"
5 4
6static void randombytes(unsigned char *x, unsigned long long xlen) { 5static void randombytes(unsigned char *x, unsigned long long xlen) {
7 assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ? 6 assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ?