Bug #74896 [NEW]: sodium's .h defines some functions without .c implementation
| From: | requinix@php.net | Date: | Tue, 11 Jul 2017 07:05:26 +0000 |
| Subject: | Bug #74896 [NEW]: sodium's .h defines some functions without .c implementation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209976@lists.php.net to get a copy of this message | ||
From: requinix
Operating system:
PHP version: master-Git-2017-07-11 (Git)
Package: Unknown/Other Function
Bug Type: Bug
Bug description:sodium's .h defines some functions without .c implementation
Description:
------------
With the libsodium PR merged I did a quick test for functions.
php_libsodium.h lists a number of sodium_* functions however some don't
have implementations in libsodium.c.
(I checked all 61 functions and found only the 8 listed below.)
My guess is they should be removed
- encrypt/decrypt look like duplicates of the non-'x'ed versions
- pwhash gets bundled into password_hash/verify()
- randombytes gets bundled into random_bytes()
...but I bet this will be a non-issue when the code gets refactored and
cleaned up later anyways.
Test script:
---------------
Given a file "sodium" containing:
sodium_crypto_aead_xchacha20poly1305_ietf_decrypt
sodium_crypto_aead_xchacha20poly1305_ietf_encrypt
sodium_crypto_pwhash
sodium_crypto_pwhash_str
sodium_crypto_pwhash_str_verify
sodium_randombytes_buf
sodium_randombytes_random16
sodium_randombytes_uniform
$ xargs -a sodium -l php --rf | grep Exception
Expected result:
----------------
No output (all functions found)
Actual result:
--------------
Exception: Function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt()
does not exist
Exception: Function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt()
does not exist
Exception: Function sodium_crypto_pwhash() does not exist
Exception: Function sodium_crypto_pwhash_str() does not exist
Exception: Function sodium_crypto_pwhash_str_verify() does not exist
Exception: Function sodium_randombytes_buf() does not exist
Exception: Function sodium_randombytes_random16() does not exist
Exception: Function sodium_randombytes_uniform() does not exist
--
Edit bug report at https://bugs.php.net/bug.php?id=74896&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74896&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74896&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74896&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74896&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74896&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74896&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74896&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74896&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74896&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74896&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74896&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74896&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74896&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74896&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74896&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74896&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74896&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74896&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74896&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74896&r=mysqlcfg