-
Notifications
You must be signed in to change notification settings - Fork 214
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
getall results in an InvalidCiphertextException #211
Comments
FWIW, downgrading to credstash-1.14.0, which in turn pulls in cryptography-2.0.3 results in a working |
Same here with macOS/homebrew, for the same versions (works fine with 1.14.0, breaks with 1.15.0). |
are any of those items using ripemd? it got taken out with 1.15. Theres a migration script you can run if anything uses it. |
Ah, right indeed, thanks! 👍 That would be worth mentioning it in the README or the release more explicitly, like:
for those that do not follow the project that close. |
Curious, on our side all our digests are SHA256, the migration script reports |
Ok, it seems that, calling
Now, an option could be to return diff --git a/credstash.py b/credstash.py
index 8c685ee..765c732 100755
--- a/credstash.py
+++ b/credstash.py
@@ -338,7 +339,9 @@ def getAllSecrets(version="", region=None, table="credential-store",
names)
pool.close()
pool.join()
- return dict(zip(names, results))
+ res = dict(zip(names, results))
+
+ return {k: v for k, v in res.items() if v is not None}
@@ -498,7 +501,11 @@ def getSecret(name, version="", region=None,
key_service = KeyService(kms, None, context)
- return open_aes_ctr_legacy(key_service, material)
+ try:
+ return open_aes_ctr_legacy(key_service, material)
+ except Exception as e:
+ print(material['name'] + ': ' + str(e))
+ return None or would storing the context as a DDB column be relevant? |
Storing the context as a DDB column such that it can be used to filter the results before attempting to decrypt everything would be a big win in my opinion. We use multiple contexts to filter creds for different microservices, and with just a few hundred key-value pairs it can take up to 30 seconds to get the results. |
I just tried with latest v1.16.2, it seems ok?
|
@chenrui333 the issue is when you have credentials stored with other contexts, and you don't so basically any version will work. We are having a similar issue with any version >1.14 of credstash. It just hangs for ever with tons of errors (we have a lot of credentials with different context).
To me the patch you provided seems OK (except the print obviously) Do you think we can work on a PR together? |
Following an upgrade from credstash-1.14.0 to credstash-1.15.0 we're no longer able to use the
getall
command together with encryption contexts.Versions
Credstash is installed in a docker container based on openjdk:7-jdk-alpine using the following steps:
Working versions from July 12th
Successfully installed
Broken combination from July 13th onwards
Successfully installed
Error message
Steps to reproduce
From a working credstash version
From a container with the broken version attempt to
get
the itemFrom a container with the broken version attempt to
getall
the itemThe text was updated successfully, but these errors were encountered: