Skip to content

Commit

Permalink
security/pecl-xxtea: Add new port
Browse files Browse the repository at this point in the history
Add security/pecl-xxtea, XXTEA encryption algorithm extension for PHP.

MFH:		2024Q1
  • Loading branch information
Yasuhiro Kimura authored and Yasuhiro Kimura committed Mar 13, 2024
1 parent eaec7c2 commit de40af5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions security/Makefile
Expand Up @@ -795,6 +795,7 @@
SUBDIR += pecl-pkcs11
SUBDIR += pecl-scrypt
SUBDIR += pecl-ssh2
SUBDIR += pecl-xxtea
SUBDIR += peda
SUBDIR += pev
SUBDIR += pgpdump
Expand Down
14 changes: 14 additions & 0 deletions security/pecl-xxtea/Makefile
@@ -0,0 +1,14 @@
PORTNAME= xxtea
DISTVERSION= 1.0.11
CATEGORIES= security

MAINTAINER= yasu@FreeBSD.org
COMMENT= XXTEA encryption algorithm extension for PHP
WWW= https://github.com/xxtea/xxtea-pecl

LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.md

USES= dos2unix php:pecl

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions security/pecl-xxtea/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1710288047
SHA256 (PECL/xxtea-1.0.11.tgz) = 5b1e318d3e70b27ad017d125d09ba3cf7bb3859e11be864a7bc3ddba421108af
SIZE (PECL/xxtea-1.0.11.tgz) = 7404
29 changes: 29 additions & 0 deletions security/pecl-xxtea/files/patch-php__xxtea.c
@@ -0,0 +1,29 @@
--- php_xxtea.c.orig 2024-03-12 22:05:18 UTC
+++ php_xxtea.c
@@ -275,7 +275,7 @@ ZEND_FUNCTION(xxtea_encrypt) {
size_t i, ret_length;
uint8_t fixed_key[16];

- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &data, &data_len, &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &data, &data_len, &key, &key_len) == FAILURE) {
return;
}
if (data_len == 0) {
@@ -308,7 +308,7 @@ ZEND_FUNCTION(xxtea_decrypt) {
size_t i, ret_length;
uint8_t fixed_key[16];

- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &data, &data_len, &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &data, &data_len, &key, &key_len) == FAILURE) {
return;
}
if (data_len == 0) {
@@ -340,7 +340,7 @@ ZEND_MINIT_FUNCTION(xxtea) {
ZEND_MINIT_FUNCTION(xxtea) {
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "XXTEA", xxtea_method);
- xxtea_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ xxtea_ce = zend_register_internal_class(&ce);
return SUCCESS;
}

4 changes: 4 additions & 0 deletions security/pecl-xxtea/pkg-descr
@@ -0,0 +1,4 @@
XXTEA is a fast and secure encryption algorithm. This is a XXTEA
extension for PHP. It is different from the original XXTEA encryption
algorithm. It encrypts and decrypts string instead of uint32 array,
and the key is also string.

0 comments on commit de40af5

Please sign in to comment.