mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Fix lost code after rebase
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
// thoroughly tested in the init and rekey command unit tests
|
||||
func EncryptShares(input [][]byte, pgpKeys []string) ([]string, [][]byte, error) {
|
||||
if len(input) != len(pgpKeys) {
|
||||
return nil, nil, fmt.Errorf("Mismatch between number of generated shares and number of PGP keys")
|
||||
return nil, nil, fmt.Errorf("Mismatch between number items to encrypt and number of PGP keys")
|
||||
}
|
||||
encryptedShares := make([][]byte, 0, len(pgpKeys))
|
||||
entities, err := GetEntities(pgpKeys)
|
||||
|
||||
@@ -210,7 +210,11 @@ func (c *Core) RekeyUpdate(key []byte, nonce string) (*RekeyResult, error) {
|
||||
}
|
||||
|
||||
if len(c.rekeyConfig.PGPKeys) > 0 {
|
||||
results.PGPFingerprints, results.SecretShares, err = pgpkeys.EncryptShares(results.SecretShares, c.rekeyConfig.PGPKeys)
|
||||
hexEncodedShares := make([][]byte, len(results.SecretShares))
|
||||
for i, _ := range results.SecretShares {
|
||||
hexEncodedShares[i] = []byte(hex.EncodeToString(results.SecretShares[i]))
|
||||
}
|
||||
results.PGPFingerprints, results.SecretShares, err = pgpkeys.EncryptShares(hexEncodedShares, c.rekeyConfig.PGPKeys)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user