diff options
author | Remi Collet <remi@remirepo.net> | 2022-05-17 07:27:15 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2022-05-17 07:27:15 +0200 |
commit | 886534b721ef59f952ed53a107481badbd1ba930 (patch) | |
tree | d19d26cbba7d385694ae4a51218eb6c911683c23 | |
parent | 186a34f6a0be991ded1a892a51cb64c748d980a3 (diff) |
update to 1.1
drop patch merged upstream
-rw-r--r-- | REFLECTION | 159 | ||||
-rw-r--r-- | php-pecl-pkcs11.spec | 13 | ||||
-rw-r--r-- | pkcs11-php81.patch | 78 |
3 files changed, 109 insertions, 141 deletions
@@ -1,6 +1,6 @@ -Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { +Extension [ <persistent> extension #91 pkcs11 version 1.1 ] { - - Constants [831] { + - Constants [835] { Constant [ int Pkcs11\CKM_RSA_PKCS_KEY_PAIR_GEN ] { 0 } Constant [ int Pkcs11\CKM_RSA_PKCS ] { 1 } Constant [ int Pkcs11\CKM_RSA_9796 ] { 2 } @@ -832,6 +832,10 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Constant [ int Pkcs11\CKR_MUTEX_NOT_LOCKED ] { 417 } Constant [ int Pkcs11\CKR_FUNCTION_REJECTED ] { 512 } Constant [ int Pkcs11\CKR_VENDOR_DEFINED ] { 2147483648 } + Constant [ int Pkcs11\CKM_YUBICO_AES_CCM_WRAP ] { 3646243332 } + Constant [ int Pkcs11\CKK_YUBICO_AES128_CCM_WRAP ] { 3646243357 } + Constant [ int Pkcs11\CKK_YUBICO_AES192_CCM_WRAP ] { 3646243369 } + Constant [ int Pkcs11\CKK_YUBICO_AES256_CCM_WRAP ] { 3646243370 } } - Classes [19] { @@ -917,23 +921,23 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [4] { Parameter #0 [ <required> int $slotid ] - Parameter #1 [ <optional> int $flags ] - Parameter #2 [ <optional> string or NULL $application ] - Parameter #3 [ <optional> callable or NULL $notify ] + Parameter #1 [ <optional> int $flags = <default> ] + Parameter #2 [ <optional> ?string $application = <default> ] + Parameter #3 [ <optional> ?callable $notify = <default> ] } } Method [ <internal:pkcs11> public method waitForSlotEvent ] { - Parameters [1] { - Parameter #0 [ <required> int or NULL $php_flags ] + Parameter #0 [ <required> ?int $php_flags ] } } Method [ <internal:pkcs11> public method C_GetInfo ] { - Parameters [1] { - Parameter #0 [ <required> array or NULL &$pInfo ] + Parameter #0 [ <required> ?array &$pInfo ] } } @@ -941,7 +945,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> bool $tokenPresent ] - Parameter #1 [ <required> array or NULL &$pSlotList ] + Parameter #1 [ <required> ?array &$pSlotList ] } } @@ -949,7 +953,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> int $slotId ] - Parameter #1 [ <required> array or NULL &$pInfo ] + Parameter #1 [ <required> ?array &$pInfo ] } } @@ -957,7 +961,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> int $slotId ] - Parameter #1 [ <required> array or NULL &$pInfo ] + Parameter #1 [ <required> ?array &$pInfo ] } } @@ -965,7 +969,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> int $slotId ] - Parameter #1 [ <required> array or NULL &$pMechanismList ] + Parameter #1 [ <required> ?array &$pMechanismList ] } } @@ -974,7 +978,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> int $slotId ] Parameter #1 [ <required> int $type ] - Parameter #2 [ <required> array or NULL &$pInfo ] + Parameter #2 [ <required> ?array &$pInfo ] } } @@ -1009,9 +1013,9 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [5] { Parameter #0 [ <required> int $slotID ] Parameter #1 [ <required> int $flags ] - Parameter #2 [ <required> string or NULL $pApplication ] - Parameter #3 [ <required> callable or NULL $notify ] - Parameter #4 [ <required> Pkcs11\Session or NULL &$hSession ] + Parameter #2 [ <required> ?string $pApplication ] + Parameter #3 [ <required> ?callable $notify ] + Parameter #4 [ <required> ?Pkcs11\Session &$hSession ] } } @@ -1026,7 +1030,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> Pkcs11\Session $session ] - Parameter #1 [ <optional> array or NULL &$pInfo ] + Parameter #1 [ <optional> ?array &$pInfo = <default> ] } } @@ -1049,8 +1053,8 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11> public method C_WaitForSlotEvent ] { - Parameters [2] { - Parameter #0 [ <required> int or NULL $php_flags ] - Parameter #1 [ <required> int or NULL &$php_slotID ] + Parameter #0 [ <required> ?int $php_flags ] + Parameter #1 [ <required> ?int &$php_slotID ] } } @@ -1060,7 +1064,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> Pkcs11\Mechanism $mechanism ] Parameter #2 [ <required> array $template ] - Parameter #3 [ <optional> IS_LONG or NULL &$phKey ] + Parameter #3 [ <optional> ?IS_LONG &$phKey = <default> ] } } @@ -1071,8 +1075,8 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Parameter #1 [ <required> Pkcs11\Mechanism $mechanism ] Parameter #2 [ <required> array $pkTemplate ] Parameter #3 [ <required> array $skTemplate ] - Parameter #4 [ <optional> Pkcs11\Key or NULL &$phPublicKey ] - Parameter #5 [ <optional> Pkcs11\Key or NULL &$phPrivateKey ] + Parameter #4 [ <optional> ?Pkcs11\Key &$phPublicKey = <default> ] + Parameter #5 [ <optional> ?Pkcs11\Key &$phPrivateKey = <default> ] } } @@ -1089,7 +1093,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> string $data ] - Parameter #2 [ <required> string or NULL &$digest ] + Parameter #2 [ <required> ?string &$digest ] } } @@ -1113,7 +1117,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> Pkcs11\Session $session ] - Parameter #1 [ <required> string or NULL &$digest ] + Parameter #1 [ <required> ?string &$digest ] } } @@ -1131,7 +1135,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> string $data ] - Parameter #2 [ <required> string or NULL &$signature ] + Parameter #2 [ <required> ?string &$signature ] } } @@ -1167,7 +1171,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> string $data ] - Parameter #2 [ <required> string or NULL &$encryptedData ] + Parameter #2 [ <required> ?string &$encryptedData ] } } @@ -1185,7 +1189,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> string $encryptedData ] - Parameter #2 [ <required> string or NULL &$data ] + Parameter #2 [ <required> ?string &$data ] } } @@ -1196,7 +1200,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Parameter #1 [ <required> Pkcs11\Mechanism $mechanism ] Parameter #2 [ <required> int $keyId ] Parameter #3 [ <required> int $targetKeyId ] - Parameter #4 [ <required> string or NULL &$ciphertext ] + Parameter #4 [ <required> ?string &$ciphertext ] } } @@ -1208,7 +1212,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Parameter #2 [ <required> int $keyId ] Parameter #3 [ <required> string $encryptedData ] Parameter #4 [ <required> array $template ] - Parameter #5 [ <required> int or NULL &$keyId ] + Parameter #5 [ <required> ?int &$keyId ] } } @@ -1216,8 +1220,8 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] - Parameter #1 [ <optional> int $RandomLen ] - Parameter #2 [ <optional> string or NULL &$pRandomData ] + Parameter #1 [ <optional> int $RandomLen = <default> ] + Parameter #2 [ <optional> ?string &$pRandomData = <default> ] } } @@ -1225,7 +1229,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> Pkcs11\Session $session ] - Parameter #1 [ <optional> string $Seed ] + Parameter #1 [ <optional> string $Seed = <default> ] } } @@ -1234,7 +1238,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> array $template ] - Parameter #2 [ <required> Pkcs11\P11Object or NULL &$phObject ] + Parameter #2 [ <required> ?Pkcs11\P11Object &$phObject ] } } @@ -1250,8 +1254,8 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Session $session ] - Parameter #1 [ <required> array or NULL &$Objects ] - Parameter #2 [ <optional> int $MaxObjectCount ] + Parameter #1 [ <required> ?array &$Objects ] + Parameter #2 [ <optional> int $MaxObjectCount = <default> ] } } @@ -1277,7 +1281,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Parameter #0 [ <required> Pkcs11\Session $session ] Parameter #1 [ <required> Pkcs11\P11Object $object ] Parameter #2 [ <required> array $template ] - Parameter #3 [ <required> Pkcs11\P11Object or NULL &$phNewObject ] + Parameter #3 [ <required> ?Pkcs11\P11Object &$phNewObject ] } } @@ -1305,7 +1309,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Properties [0] { } - - Methods [16] { + - Methods [17] { Method [ <internal:pkcs11> public method login ] { - Parameters [2] { @@ -1398,7 +1402,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> Pkcs11\Mechanism $mechanism ] Parameter #1 [ <required> array $pkTemplate ] - Parameter #2 [ <optional> array $skTemplate ] + Parameter #2 [ <optional> array $skTemplate = <default> ] } } @@ -1416,6 +1420,13 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { } } + Method [ <internal:pkcs11> public method openUri ] { + + - Parameters [1] { + Parameter #0 [ <required> string $uri ] + } + } + Method [ <internal:pkcs11> public method __debugInfo ] { - Parameters [0] { @@ -1665,7 +1676,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [3] { Parameter #0 [ <required> int $mechanismId ] Parameter #1 [ <required> int $mgfId ] - Parameter #2 [ <optional> string or NULL $source ] + Parameter #2 [ <optional> ?string $source = <default> ] } } } @@ -1716,7 +1727,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> string $nonce ] - Parameter #1 [ <optional> string $blockCounter ] + Parameter #1 [ <optional> string $blockCounter = <default> ] } } } @@ -1741,7 +1752,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> string $nonce ] - Parameter #1 [ <optional> string $blockCounter ] + Parameter #1 [ <optional> string $blockCounter = <default> ] } } } @@ -1766,7 +1777,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { - Parameters [2] { Parameter #0 [ <required> string $nonce ] - Parameter #1 [ <optional> string $aad ] + Parameter #1 [ <optional> string $aad = <default> ] } } } @@ -1816,7 +1827,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11, ctor> public method update ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $data ] + Parameter #0 [ <required> ?string $data ] } } @@ -1846,14 +1857,14 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11, ctor> public method update ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $data ] + Parameter #0 [ <required> ?string $data ] } } Method [ <internal:pkcs11, ctor> public method finalize ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $signature ] + Parameter #0 [ <required> ?string $signature ] } } } @@ -1877,14 +1888,14 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11, ctor> public method update ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $data ] + Parameter #0 [ <required> ?string $data ] } } Method [ <internal:pkcs11, ctor> public method keyUpdate ] { - Parameters [1] { - Parameter #0 [ <required> object or NULL $key ] + Parameter #0 [ <required> ?object $key ] } } @@ -1914,7 +1925,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11, ctor> public method update ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $data ] + Parameter #0 [ <required> ?string $data ] } } @@ -1944,7 +1955,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { Method [ <internal:pkcs11, ctor> public method update ] { - Parameters [1] { - Parameter #0 [ <required> string or NULL $data ] + Parameter #0 [ <required> ?string $data ] } } @@ -1956,7 +1967,7 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { } } - Class [ <internal:pkcs11> class Pkcs11\Exception extends Exception implements Throwable ] { + Class [ <internal:pkcs11> class Pkcs11\Exception extends Exception implements Throwable, Stringable ] { - Constants [0] { } @@ -1968,47 +1979,81 @@ Extension [ <persistent> extension #93 pkcs11 version 1.0 ] { } - Properties [4] { - Property [ <default> protected $message ] - Property [ <default> protected $code ] - Property [ <default> protected $file ] - Property [ <default> protected $line ] + Property [ protected $message = '' ] + Property [ protected $code = 0 ] + Property [ protected $file = NULL ] + Property [ protected $line = NULL ] } - Methods [10] { Method [ <internal:Core, inherits Exception, ctor> public method __construct ] { - Parameters [3] { - Parameter #0 [ <optional> $message ] - Parameter #1 [ <optional> $code ] - Parameter #2 [ <optional> $previous ] + Parameter #0 [ <optional> string $message = "" ] + Parameter #1 [ <optional> int $code = 0 ] + Parameter #2 [ <optional> ?Throwable $previous = null ] } } Method [ <internal:Core, inherits Exception> public method __wakeup ] { + + - Parameters [0] { + } } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] { + + - Parameters [0] { + } + - Return [ string ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] { + + - Parameters [0] { + } } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] { + + - Parameters [0] { + } + - Return [ string ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] { + + - Parameters [0] { + } + - Return [ int ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] { + + - Parameters [0] { + } + - Return [ array ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] { + + - Parameters [0] { + } + - Return [ ?Throwable ] } Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] { + + - Parameters [0] { + } + - Return [ string ] } - Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] { + Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] { + + - Parameters [0] { + } + - Return [ string ] } } } diff --git a/php-pecl-pkcs11.spec b/php-pecl-pkcs11.spec index 2b8f171..eef7c8e 100644 --- a/php-pecl-pkcs11.spec +++ b/php-pecl-pkcs11.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-pkcs11 # -# Copyright (c) 2020-2021 Remi Collet +# Copyright (c) 2020-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -28,14 +28,12 @@ Summary: PHP Bindings for PKCS11 modules Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 1.0 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 1.1 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: %{pecl_name}-php81.patch - BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.4 @@ -86,7 +84,6 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{version} NTS cd NTS -%patch0 -p1 find . -type f -exec chmod -x {} ';' # Sanity check, really often broken @@ -222,6 +219,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Tue May 17 2022 Remi Collet <remi@remirepo.net> - 1.1-1 +- update to 1.1 +- drop patch merged upstream + * Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 1.0-2 - add patch for PHP 8.1 from https://github.com/gamringer/php-pkcs11/pull/59 diff --git a/pkcs11-php81.patch b/pkcs11-php81.patch deleted file mode 100644 index c1e8023..0000000 --- a/pkcs11-php81.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 99e8980282d7f05f8956bc071eaa823513d44c15 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Fri, 10 Sep 2021 14:35:47 +0200 -Subject: [PATCH] use ZEND_ACC_NOT_SERIALIZABLE for PHP 8.1 - ---- - pkcs11int.h | 33 +++++++++++++++++++++++++++++++++ - pkcs11key.c | 6 +++++- - 2 files changed, 38 insertions(+), 1 deletion(-) - -diff --git a/pkcs11int.h b/pkcs11int.h -index 69cd92a..dfbe62b 100644 ---- a/pkcs11int.h -+++ b/pkcs11int.h -@@ -192,6 +192,8 @@ DECLARE_MAGIC_FUNCS(pkcs11_digestcontext, DigestContext) - DECLARE_MAGIC_FUNCS(pkcs11_encryptioncontext, EncryptionContext) - DECLARE_MAGIC_FUNCS(pkcs11_decryptioncontext, DecryptionContext) - -+#if PHP_VERSION_ID < 80100 -+ - #define DEFINE_MAGIC_FUNCS(tt, lowername, classname) \ - static zend_object *tt##_ctor(zend_class_entry *ce) { \ - tt##_object *objval = zend_object_alloc(sizeof(tt##_object), ce); \ -@@ -220,6 +222,37 @@ void register_##tt() { - ce_Pkcs11_##classname->unserialize = zend_class_unserialize_deny; \ - } - -+#else -+ -+#define DEFINE_MAGIC_FUNCS(tt, lowername, classname) \ -+static zend_object *tt##_ctor(zend_class_entry *ce) { \ -+ tt##_object *objval = zend_object_alloc(sizeof(tt##_object), ce); \ -+ \ -+ zend_object_std_init(&objval->std, ce); \ -+ object_properties_init(&objval->std, ce); \ -+ objval->std.handlers = &tt##_handlers; \ -+ \ -+ return &objval->std; \ -+} \ -+static void tt##_dtor(zend_object *zobj) { \ -+ tt##_object *objval = tt##_from_zend_object(zobj); \ -+ tt##_shutdown(objval); \ -+ zend_object_std_dtor(&objval->std); \ -+} \ -+void register_##tt() { \ -+ zend_class_entry ce; \ -+ memcpy(&tt##_handlers, &std_object_handlers, sizeof(zend_object_handlers)); \ -+ INIT_NS_CLASS_ENTRY(ce, "Pkcs11", #classname, lowername##_class_functions); \ -+ ce.create_object = tt##_ctor; \ -+ tt##_handlers.offset = XtOffsetOf(tt##_object, std); \ -+ tt##_handlers.clone_obj = NULL; \ -+ tt##_handlers.free_obj = tt##_dtor; \ -+ ce_Pkcs11_##classname = zend_register_internal_class(&ce); \ -+ ce_Pkcs11_##classname->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; \ -+} -+ -+#endif -+ - - extern void pkcs11_error(CK_RV rv, char *error); - extern void general_error(char *generic, char *specific); -diff --git a/pkcs11key.c b/pkcs11key.c -index 1b84b43..2d7f493 100644 ---- a/pkcs11key.c -+++ b/pkcs11key.c -@@ -612,6 +612,10 @@ void register_pkcs11_key() { - pkcs11_key_handlers.offset = XtOffsetOf(pkcs11_key_object, std); - pkcs11_key_handlers.clone_obj = NULL; - ce_Pkcs11_Key = zend_register_internal_class_ex(&ce, ce_Pkcs11_P11Object); -+#if PHP_VERSION_ID < 80100 - ce_Pkcs11_Key->serialize = zend_class_serialize_deny; - ce_Pkcs11_Key->unserialize = zend_class_unserialize_deny; --} -\ No newline at end of file -+#else -+ ce_Pkcs11_Key->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; -+#endif -+} |