Skip to content

Commit

Permalink
Adds an option to perform encryption operations with no HMAC required. (
Browse files Browse the repository at this point in the history
#170)

* Adds an option to perform encryption operations with no HMAC required. Certain AES mechanisms require an HMAC when used as a seal, but this behavior is not desired when used as a managed key.

* Change option name from WithNoHMAC to WithoutHMAC.
  • Loading branch information
schultz-is authored Jun 21, 2023
1 parent 08d524b commit 7f7cee7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 51 deletions.
113 changes: 62 additions & 51 deletions git.luolix.top.hashicorp.go.kms.wrapping.v2.types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions git.luolix.top.hashicorp.go.kms.wrapping.v2.types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ message Options {
KeyEncoding with_wrapped_key_encoding = 80;

bool with_disallow_env_vars = 90;

// WithoutHmac specifies that an HMAC is not necessary for the mechanism, even if marked as "required"
bool without_hmac = 100;
}

// SigInfo contains information about a cryptographic signature
Expand Down
10 changes: 10 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,13 @@ func WithDisallowEnvVars(disallowEnvVars bool) Option {
})
}
}

// WithoutHMAC disables the requirement for an HMAC to be included with the mechanism.
func WithoutHMAC() Option {
return func() interface{} {
return OptionFunc(func(o *Options) error {
o.WithoutHmac = true
return nil
})
}
}

0 comments on commit 7f7cee7

Please sign in to comment.