Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend acra-keys export/import subcommand #629

Merged
merged 13 commits into from
Feb 6, 2023
6 changes: 6 additions & 0 deletions keystore/filesystem/filesystem_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ func readFilesAsKeys(files []string, basePath string, encryptor keystore.KeyEncr
}
}

// additional verification of public key, there is no need to verify private keys
// as private keys are encrypted and validated during description step
if isPublic(relativeName) {
if err := verifyPublicKey(&keys.PublicKey{
Value: content,
Expand Down Expand Up @@ -195,6 +197,8 @@ func (store *KeyBackuper) Export(exportIDs []keystore.ExportID, mode keystore.Ex
return nil, err
}

// additional verification of public key, there is no need to verify private keys
// as private keys are encrypted and validated during description step
if err := verifyPublicKey(keypair.Public); err != nil {
log.WithError(err).Error("Invalid public key for export")
return nil, err
Expand Down Expand Up @@ -223,6 +227,8 @@ func (store *KeyBackuper) Export(exportIDs []keystore.ExportID, mode keystore.Ex
return nil, err
}

// additional verification of public key, there is no need to verify private keys
// as private keys are encrypted and validated during description step
if err := verifyPublicKey(key); err != nil {
log.WithError(err).Error("Invalid public key for export")
return nil, err
Expand Down