From 3c8273cd4b7eccf52719cee3e0df871382be4ee3 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Sun, 29 Jun 2014 16:14:16 -0700 Subject: [PATCH] Add .gpg filename extension to in-repo encrypted keys This will help distinguish keys encrypted with GPG from keys encrypted by other means. (For example, a future version of git-crypt might support passphrase-encrypted keys.) --- commands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands.cpp b/commands.cpp index 41f41ab..1b99435 100644 --- a/commands.cpp +++ b/commands.cpp @@ -319,7 +319,7 @@ static bool decrypt_repo_key (Key_file& key_file, const char* key_name, uint32_t { for (std::vector::const_iterator seckey(secret_keys.begin()); seckey != secret_keys.end(); ++seckey) { std::ostringstream path_builder; - path_builder << keys_path << '/' << (key_name ? key_name : "default") << '/' << key_version << '/' << *seckey; + path_builder << keys_path << '/' << (key_name ? key_name : "default") << '/' << key_version << '/' << *seckey << ".gpg"; std::string path(path_builder.str()); if (access(path.c_str(), F_OK) == 0) { std::stringstream decrypted_contents; @@ -348,7 +348,7 @@ static void encrypt_repo_key (const char* key_name, uint32_t key_version, const for (std::vector::const_iterator collab(collab_keys.begin()); collab != collab_keys.end(); ++collab) { std::ostringstream path_builder; - path_builder << keys_path << '/' << (key_name ? key_name : "default") << '/' << key_version << '/' << *collab; + path_builder << keys_path << '/' << (key_name ? key_name : "default") << '/' << key_version << '/' << *collab << ".gpg"; std::string path(path_builder.str()); if (access(path.c_str(), F_OK) == 0) {