Skip to content

Commit

Permalink
Fix ent encode test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sgmiller committed Jan 6, 2025
1 parent 27c4d9f commit fbf4306
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions builtin/logical/transit/path_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ func getExportKey(policy *keysutil.Policy, key *keysutil.KeyEntry, exportType st
return rsaKey, nil
default:
key, err := entEncodePrivateKey(exportType, policy, key)
if key != "" && err == nil {
if err != nil {
return "", err
}
if key != "" {
return key, nil
}
}
Expand Down Expand Up @@ -260,7 +263,10 @@ func getExportKey(policy *keysutil.Policy, key *keysutil.KeyEntry, exportType st
return rsaKey, nil
default:
key, err := entEncodePublicKey(exportType, policy, key)
if key != "" && err == nil {
if err != nil {
return "", err
}
if key != "" {
return key, nil
}
}
Expand Down

0 comments on commit fbf4306

Please sign in to comment.