-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No valid bundles were found in the data directory. #15
Comments
This is happening inconsistently on some of our VMs in house, too. It's definitely a bug, but I'm not certain where it lies yet. I'll release a fix as soon as I find it. |
Can you reproduce this in v1.0.2? I think upgrading sodium_compat to v1.6.0 fixed the issue, but I might just be having difficulty reproducing it in our lab. |
I applied all the codes, including the symlink and @jonathantittle's, nothing worked and the page stoped working. Maybe your guide didn't tell which files to require. |
If you're using Composer, you only need If you're not using Composer, you take the responsibility of autoloading files, etc. into your own hands. Use Composer, please. |
I use Composer. But I didn't copy the whole composer to my web site server because they are many files, therefore, I copied only the folder |
That's almost certainly a bad idea.
Have you tried |
I have just updated, I have the folders |
Wait, I am a bit confused, for the web site to work, do I have to copy the |
I'm having the same issue on PHP 7.2.3. |
It seems to fail when the Ed25519 signature is checked, in
The newest one has these signature values:
By the way, I use Certainty via https://github.com/DivineOmega/password_exposed/. |
By the way, I use libsodium 1.0.16. Let me know if you need anything to reproduce the issue. |
Can you please clone Certainty, run <?php
require 'vendor/autoload.php';
$json = \json_decode(file_get_contents('data/ca-certs.json'), true);
$pk = hex2bin('98f2dfad4115fea9f096c35485b3bf20b06e94acac3b7acf6185aa5806020342');
foreach ($json as $row) {
$miss = false;
$file = $row['file'];
$contents = \file_get_contents('data/' . $file);
$sha256 = hex2bin($row['sha256']);
$signature = hex2bin($row['signature']);
if (\hash_file('sha256', 'data/' . $file, true) !== $sha256) {
if (!$miss) {
echo $file, PHP_EOL;
}
$miss = true;
echo "\tHash mismatch (hash_file())!\n";
}
if (\hash('sha256', $contents, true) !== $sha256) {
if (!$miss) {
echo $file, PHP_EOL;
}
$miss = true;
echo "\tHash mismatch (hash())!\n";
}
if (!\ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $contents, $pk)) {
if (!$miss) {
echo $file, PHP_EOL;
}
$miss = true;
echo "\tSignature invalid (ParagonIE_Sodium_Compat)!\n";
}
if (!\ParagonIE_Sodium_File::verify($signature, 'data/' . $file, $pk)) {
if (!$miss) {
echo $file, PHP_EOL;
}
$miss = true;
echo "\tSignature invalid (ParagonIE_Sodium_File)!\n";
}
} |
|
This is as far as I was able to get with debugging. It's incredibly unlikely that the SHA256 hash would match, but suddenly the signature would fail, unless there was a bug in Maybe I'll refactor Certainty to just load the whole file into memory and use |
Can you pull dev-master, delete |
I can confirm that it works now. By the way, I also get the warning |
Okay, so, I think the original issue is filesystem-related and probably a heisenbug.
|
Releasing |
Awesome. Bug gone, warning gone. Thank you for the very quick response. |
Happy to help. :) Hopefully this bug is gone for everyone in |
Hmm, this bug seems to be happening again :/ Seems to be caused by line 93 in Fetch.php (paragonie/certainty/src/Fetch.php): $valid = $valid && $validator->checkChronicleHash($bundle); The certs DO download (using v1.8.1 of sodium compat), but they fail this check. Any hints? |
Update to the latest version of Certainty. Our public key was rotated. |
Oh, I thought I did fetch the latest, i'll run "composer update again" Maybe a message could be added to detect this and give a warning in the log that the public key could rotate / an update might be needed. How often should this be updated, before the key rotates again in the future? any way to fetch the key automatically? Or no? |
There's no way to broadcast these messages. All the client-side software sees is "invalid public key" or "invalid signature". This exists to prevent downgrade attacks and subsequent social engineering.
Realistically, never. An error with our deployment script copied the key I created locally, so I had to rotate the key for the PHP community's Chronicle. The most robust solution is to query a replica instead of the main instance, as documented here. |
I have the latest version and still get:
|
Seems to be the exact same failure as before: Line 93 of Fetch.php:
|
It should be line 118. Make sure you're using version 2.x not 1.x (the latest is |
I'm using certainty 2.3.2. I am using PHPStorm, and have used "composer update" and their UI for managing composer dependencies and it hasn't found a newer version. I'll use command line, and force it to update (using |
Version 2.5 and older are expected to fail. 2.6 is the fixed version. https://github.com/paragonie/certainty/releases/tag/v2.6.0 |
Yup. Everything seems to be working. I thought I had the latest version this entire time. PHPStorm... you betray me..... I really appreciate your help with this. Honestly the best support I've ever seen for an Open Source project. If anybody else encounters this issue they can run this (in the root of their project with their composer json):
|
I'm happy to hear this! We take bugs seriously (especially if they could imply security consequences on specific platforms). :) |
PHP Version: 7.2.2
When running a test to check the file path is valid using:
I'm met with:
Looking to
./data
I'm seeing:Thus it looks like we just need an updated
cacert-*.pem
correct?The text was updated successfully, but these errors were encountered: