From 4caf75384bfc30a93f5333c97f6af6e54637f2c0 Mon Sep 17 00:00:00 2001 From: "Robert A. Vincent II (Bob-Vee)" Date: Thu, 29 Jul 2021 11:56:16 -0400 Subject: [PATCH] Issue #179 Fix encryption/decryption of empty eyaml values --- lib/hiera/backend/eyaml/parser/encrypted_tokens.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb b/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb index 4d778e5..78b704a 100644 --- a/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb +++ b/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb @@ -108,7 +108,7 @@ def create_enc_token(match, type, enc_comma, cipher, indentation = '') class EncHieraTokenType < EncTokenType def initialize - @regex = %r{ENC\[(\w+,)?([a-zA-Z0-9+/ =\n]+?)\]} + @regex = %r{ENC\[(\w+,)?([a-zA-Z0-9+/ =\n]*?)\]} @string_token_type = EncStringTokenType.new end @@ -119,7 +119,7 @@ def create_token(string) class EncStringTokenType < EncTokenType def initialize - @regex = %r{ENC\[(\w+,)?([a-zA-Z0-9+/=]+?)\]} + @regex = %r{ENC\[(\w+,)?([a-zA-Z0-9+/=]*?)\]} end def create_token(string)