Merge pull request #3446 from stefanberger/cleanup

Wrap creation of CryptoConfig in constructors
This commit is contained in:
Phil Estes
2019-07-24 14:46:13 -04:00
committed by GitHub
5 changed files with 32 additions and 30 deletions

View File

@@ -88,11 +88,8 @@ var decryptCommand = cli.Command{
return err
}
cc := &encconfig.CryptoConfig{
DecryptConfig: &encconfig.DecryptConfig{
Parameters: dcparameters,
},
}
cc := encconfig.InitDecryption(dcparameters)
_, err = decryptImage(client, ctx, local, newName, cc, layers32, context.StringSlice("platform"))
return err

View File

@@ -133,14 +133,8 @@ var encryptCommand = cli.Command{
dcparameters["privkeys-passwords"] = privKeysPasswords
dcparameters["x509s"] = decX509s
cc := &encconfig.CryptoConfig{
EncryptConfig: &encconfig.EncryptConfig{
Parameters: parameters,
DecryptConfig: encconfig.DecryptConfig{
Parameters: dcparameters,
},
},
}
cc := encconfig.InitEncryption(parameters, dcparameters)
_, err = encryptImage(client, ctx, local, newName, cc, layers32, context.StringSlice("platform"))
return err