Skip to content
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

Invalid arn us-west-1 #1

Open
troyfactor4 opened this issue Apr 8, 2020 · 1 comment
Open

Invalid arn us-west-1 #1

troyfactor4 opened this issue Apr 8, 2020 · 1 comment

Comments

@troyfactor4
Copy link

Greetings,

First off, thanks for creating this great tool. Can't wait to start using it. I'm having an issue perhaps you can assist. After a compile I ran the test command from the README and here is the result:

OpenSSL version: "OpenSSL 1.1.1 11 Sep 2018"

openssl pkey -engine ./target/release/libopenssl_engine_kms.so -inform engine -in arn:aws:kms:us-west-1:<redacted aws id>:key/<redacted key guid> -pubout -text
engine "kms" set.
[2020-04-08T20:14:06Z ERROR openssl_engine_kms] load key err for key id arn:aws:kms:us-west-1:<redacted aws id>:key/<redacted key guid>: Invalid arn us-west-1
cannot load key from engine
140333683679680:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:../crypto/engine/eng_pkey.c:78:
unable to load key

I've tried using just the GUID for the key instead of the full ARN. In this case it seems it does not read my AWS config for region and defaults to eu-west-1.

openssl pkey -engine ./target/release/libopenssl_engine_kms.so -inform engine -in <redacted key guid> -pubout -text
engine "kms" set.
[2020-04-08T20:06:33Z ERROR openssl_engine_kms] load key err for key id <redacted key guid>: Key 'arn:aws:kms:eu-west-1:<redacted aws id>:key/<redacted key guid>' does not exist
cannot load key from engine
140016652227008:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:../crypto/engine/eng_pkey.c:78:
unable to load key

Any suggestions for me? Can I help debug somehow?

@troyfactor4
Copy link
Author

This fixed it for me:

diff --git a/src/lib.rs b/src/lib.rs
index 0225a18..0cd17d3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -149,7 +149,7 @@ static RAND_METH: rand_meth_st = rand_meth_st {
 };
 
 lazy_static! {
-    static ref KMS_CLIENT: KmsClient = KmsClient::new(Region::EuWest1);
+    static ref KMS_CLIENT: KmsClient = KmsClient::new(Region::default());
     static ref KEYS: Mutex<HashMap<usize, String>> = Mutex::new(HashMap::new());
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant