Skip to content

Create CryptoConfig constructors to replace dcparameters#3452

Merged
estesp merged 2 commits intocontainerd:masterfrom
lumjjb:keybundles
Jul 25, 2019
Merged

Create CryptoConfig constructors to replace dcparameters#3452
estesp merged 2 commits intocontainerd:masterfrom
lumjjb:keybundles

Conversation

@lumjjb
Copy link
Copy Markdown
Contributor

@lumjjb lumjjb commented Jul 25, 2019

As a first step to #3443, we've provided interfaces via the encryption library to create the necessary CryptoConfig structures for encryption/decryption without the need to know internals of the encryption scheme..

We've implemented the following interfaces and updated ctr usage to use it. In addition, there is no longer any use of dcparameters in the codebase outside the encryption library - which uses its internals.

func EncryptWithJwe(pubKeys [][]byte) (CryptoConfig, error) 
func EncryptWithPkcs7(x509s [][]byte) (CryptoConfig, error) 
func EncryptWithGpg(gpgRecipients [][]byte, gpgPubRingFile []byte) (CryptoConfig, error) 
func DecryptWithPrivKeys(privKeys [][]byte, privKeysPasswords [][]byte) (CryptoConfig, error) 
func DecryptWithX509s(x509s [][]byte) (CryptoConfig, error) 
func DecryptWithGpgPrivKeys(gpgPrivKeys, gpgPrivKeysPwds [][]byte) (CryptoConfig, error) 

We are thinking that when the OCI spec gets merged, an option is for the pkg/encryption library to be under the OCI repo. So this would be the interface provided to create the configurations.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 25, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #3452 into master will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3452      +/-   ##
==========================================
+ Coverage   44.11%   44.22%   +0.11%     
==========================================
  Files         124      124              
  Lines       13760    13724      -36     
==========================================
  Hits         6070     6070              
+ Misses       6759     6723      -36     
  Partials      931      931
Flag Coverage Δ
#linux 48.01% <0%> (+0.13%) ⬆️
#windows 39.88% <0%> (+0.12%) ⬆️
Impacted Files Coverage Δ
pkg/encryption/gpg.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdab4f4...3d1fa69. Read the comment docs.

1 similar comment
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #3452 into master will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3452      +/-   ##
==========================================
+ Coverage   44.11%   44.22%   +0.11%     
==========================================
  Files         124      124              
  Lines       13760    13724      -36     
==========================================
  Hits         6070     6070              
+ Misses       6759     6723      -36     
  Partials      931      931
Flag Coverage Δ
#linux 48.01% <0%> (+0.13%) ⬆️
#windows 39.88% <0%> (+0.12%) ⬆️
Impacted Files Coverage Δ
pkg/encryption/gpg.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdab4f4...3d1fa69. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

Awesome improvement

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 7ff2343 into containerd:master Jul 25, 2019
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

Successfully merging this pull request may close these issues.

4 participants