Fix lost code after rebase

This commit is contained in:
Jeff Mitchell
2016-01-19 19:19:07 -05:00
parent e9538f1441
commit 152f4a9391
2 changed files with 6 additions and 2 deletions

View File

@@ -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)

View File

@@ -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
}