php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74826 libsodium does not appear to be present
Submitted: 2017-06-29 02:18 UTC Modified: 2017-07-11 07:06 UTC
From: terrafrost@php.net Assigned: requinix (profile)
Status: Closed Package: *Encryption and hash functions
PHP Version: 7.2.0alpha2 OS: Windows 10
Private report: No CVE-ID: None
 [2017-06-29 02:18 UTC] terrafrost@php.net
Description:
------------
I downloaded PHP 7.2.0alpha2 for Windows / VC15 x64 Non Thread Safe (2017-Jun-21 00:03:34) and I'm not seeing libsodium in it. According to https://wiki.php.net/rfc/libsodium it's supposed to be in PHP 7.2.

I don't see any "sodium" or "libsodium" extension in the ext directory.

The word "sodium" does not appear in the output of php -i:

https://pastebin.com/N8wtGG8c

I also tried the example at the end of https://paragonie.com/book/pecl-libsodium/read/05-publickey-crypto.md#crypto-sign-seed-keypair and it didn't work.



Test script:
---------------
<?php

$bob_seed = \Sodium\randombytes_buf(\Sodium\CRYPTO_SIGN_SEEDBYTES);
$bob_sign_kp = \Sodium\crypto_sign_seed_keypair($bob_seed);

Expected result:
----------------
Not a Fatal error...

Actual result:
--------------
Fatal error: Uncaught Error: Call to undefined function Sodium\randombytes_buf() in C:\path\to\test.php:3
Stack trace:
#0 {main}
  thrown in C:\path\to\test.php on line 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-29 03:13 UTC] requinix@php.net
PR is being worked on https://github.com/php/php-src/pull/2560 and feature freeze isn't until July 20th.

I'll leave this open as a reminder but right now there is no problem.


Note that it will use global functions and constants, not a namespace.

$bob_seed = sodium_randombytes_buf(SODIUM_CRYPTO_SIGN_SEEDBYTES);
$bob_sign_kp = sodium_crypto_sign_seed_keypair($bob_seed);
 [2017-07-11 07:06 UTC] requinix@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: requinix
 [2017-07-11 07:06 UTC] requinix@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

~/php$ master/bin/php -v
PHP 7.2.0-dev (cli) (built: Jul 10 2017 23:24:01) ( NTS DEBUG )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
~/php$ master/bin/php -i | grep sodium
sodium
sodium support => enabled
libsodium headers version => 1.0.8
libsodium library version => 1.0.8

But see bug #74896.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC