We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47fb81c commit c54bbaaCopy full SHA for c54bbaa
src/MongoDB/ClientEncryption.c
@@ -193,6 +193,9 @@ void php_phongo_clientencryption_init_ce(INIT_FUNC_ARGS) /* {{{ */
193
php_phongo_handler_clientencryption.free_obj = php_phongo_clientencryption_free_object;
194
php_phongo_handler_clientencryption.offset = XtOffsetOf(php_phongo_clientencryption_t, std);
195
#endif
196
+
197
+ zend_declare_class_constant_string(php_phongo_clientencryption_ce, ZEND_STRL("AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC"), MONGOC_AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC TSRMLS_CC);
198
+ zend_declare_class_constant_string(php_phongo_clientencryption_ce, ZEND_STRL("AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM"), MONGOC_AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM TSRMLS_CC);
199
} /* }}} */
200
201
/*
tests/clientEncryption/clientEncryption-constants.phpt
@@ -0,0 +1,15 @@
1
+--TEST--
2
+MongoDB\Driver\ClientEncryption constants
3
+--FILE--
4
+<?php
5
6
+var_dump(MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC);
7
+var_dump(MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM);
8
9
+?>
10
+===DONE===
11
+<?php exit(0); ?>
12
+--EXPECT--
13
+string(43) "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
14
+string(36) "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
15
tests/clientEncryption/clientEncryption-decrypt-001.phpt
@@ -16,7 +16,7 @@ $clientEncryption = $manager->createClientEncryption(['keyVaultNamespace' => 'de
16
17
$key = $clientEncryption->createDataKey('local');
18
19
-$encrypted = $clientEncryption->encrypt('top-secret', ['keyId' => $key, 'algorithm' => 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic']);
+$encrypted = $clientEncryption->encrypt('top-secret', ['keyId' => $key, 'algorithm' => MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC]);
20
var_dump($clientEncryption->decrypt($encrypted));
21
22
?>
tests/clientEncryption/clientEncryption-encrypt-001.phpt
-var_dump($clientEncryption->encrypt('top-secret', ['keyId' => $key, 'algorithm' => 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic']));
+var_dump($clientEncryption->encrypt('top-secret', ['keyId' => $key, 'algorithm' => MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC]));
===DONE===
tests/manager/manager-ctor-auto_encryption-001.phpt
@@ -28,7 +28,7 @@ $tests = [
28
],
29
30
'bsonType' => 'objectId',
31
- 'algorithm' => 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
+ 'algorithm' => MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
32
33
34
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments