Skip to content

Commit

Permalink
Merge pull request #15 from PHPCompatibility/feature/update-for-compa…
Browse files Browse the repository at this point in the history
…tibility-with-sodium-compat-v1.11.0

Update for compatibility with sodium_compat v 1.11.0
  • Loading branch information
wimg authored Oct 16, 2019
2 parents b1bb79a + d2583e2 commit 5034401
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
21 changes: 21 additions & 0 deletions PHPCompatibilityParagonieSodiumCompat/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<exclude name="PHPCompatibility.Constants.NewConstants.sodium_crypto_stream_noncebytesFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.sodium_library_version_majorFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.sodium_library_version_minorFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_addFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_base642binFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_bin2base64Found"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_bin2hexFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_compareFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_aead_aes256gcm_decryptFound"/>
Expand Down Expand Up @@ -109,8 +112,17 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_generichash_initFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_generichash_keygenFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_generichash_updateFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kdf_derive_from_keyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kdf_keygenFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kxFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_client_session_keysFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_keypairFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_publickeyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_secretkeyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_seed_keypairFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_kx_server_session_keysFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_pwhash_strFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_pwhash_str_needs_rehashFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_pwhash_str_verifyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_pwhash_scryptsalsa208sha256Found"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_pwhash_scryptsalsa208sha256_strFound"/>
Expand All @@ -120,11 +132,18 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretboxFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretbox_keygenFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretbox_openFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_keygenFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_init_pullFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_init_pushFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_pullFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_pushFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_secretstream_xchacha20poly1305_rekeyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_shorthashFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_shorthash_keygenFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_signFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_detachedFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypairFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypair_from_secretkey_and_publickeyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_openFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_publickeyFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_publickey_from_secretkeyFound"/>
Expand All @@ -142,9 +161,11 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_library_version_minorFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_version_stringFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_memcmpFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_padFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_randombytes_bufFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_randombytes_uniformFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_randombytes_random16Found"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sodium_unpadFound"/>
</rule>

<!-- Prevent false positives being thrown when run over the code of sodium_compat itself. -->
Expand Down
20 changes: 20 additions & 0 deletions Test/ParagonieSodiumCompatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ function SodiumExceptionTypeHint( SodiumException $a ) {}
echo SODIUM_LIBRARY_VERSION_MAJOR;
echo SODIUM_LIBRARY_VERSION_MINOR;

sodium_add();
sodium_base642bin();
sodium_bin2base64();
sodium_bin2hex();
sodium_compare();
sodium_crypto_aead_aes256gcm_decrypt();
Expand Down Expand Up @@ -104,8 +107,16 @@ function SodiumExceptionTypeHint( SodiumException $a ) {}
sodium_crypto_generichash_init();
sodium_crypto_generichash_keygen();
sodium_crypto_generichash_update();
sodium_crypto_kdf_derive_from_key();
sodium_crypto_kx();
sodium_crypto_kx_client_session_keys();
sodium_crypto_kx_keypair();
sodium_crypto_kx_publickey();
sodium_crypto_kx_secretkey();
sodium_crypto_kx_seed_keypair();
sodium_crypto_kx_server_session_keys();
sodium_crypto_pwhash_str();
sodium_crypto_pwhash_str_needs_rehash();
sodium_crypto_pwhash_str_verify();
sodium_crypto_pwhash_scryptsalsa208sha256();
sodium_crypto_pwhash_scryptsalsa208sha256_str();
Expand All @@ -115,11 +126,18 @@ function SodiumExceptionTypeHint( SodiumException $a ) {}
sodium_crypto_secretbox();
sodium_crypto_secretbox_keygen();
sodium_crypto_secretbox_open();
sodium_crypto_secretstream_xchacha20poly1305_keygen();
sodium_crypto_secretstream_xchacha20poly1305_init_pull();
sodium_crypto_secretstream_xchacha20poly1305_init_push();
sodium_crypto_secretstream_xchacha20poly1305_pull();
sodium_crypto_secretstream_xchacha20poly1305_push();
sodium_crypto_secretstream_xchacha20poly1305_rekey();
sodium_crypto_shorthash();
sodium_crypto_shorthash_keygen();
sodium_crypto_sign();
sodium_crypto_sign_detached();
sodium_crypto_sign_keypair();
sodium_crypto_sign_keypair_from_secretkey_and_publickey();
sodium_crypto_sign_open();
sodium_crypto_sign_publickey();
sodium_crypto_sign_publickey_from_secretkey();
Expand All @@ -137,6 +155,8 @@ function SodiumExceptionTypeHint( SodiumException $a ) {}
sodium_library_version_minor();
sodium_version_string();
sodium_memcmp();
sodium_pad();
sodium_randombytes_buf();
sodium_randombytes_uniform();
sodium_randombytes_random16();
sodium_unpad();

0 comments on commit 5034401

Please sign in to comment.