Skip to content

Commit

Permalink
Fixed KRA key recovery via CLI in FIPS mode.
Browse files Browse the repository at this point in the history
Based on investigation and solution provided by cfu and jmagne,
the SecurityDataRecoveryService.serviceRequest() has been modified
to use EncryptionUnit.unwrap_temp() for key recovery via CLI in
FIPS mode.

https://fedorahosted.org/pki/ticket/2500
  • Loading branch information
edewata committed Nov 1, 2016
1 parent 613d8e8 commit 650b00d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ public SymmetricKey unwrap_symmetric(byte sessionKey[], String symmAlgOID,
public SymmetricKey unwrap_sym(byte encSymmKey[],
SymmetricKey.Usage usage);

public PrivateKey unwrap_temp(byte privateKey[], PublicKey pubKey)
throws EBaseException;

/**
* Unwraps data. This method rebuilds the private key by
* unwrapping the private key data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public boolean serviceRequest(IRequest request)
byte[] privateKeyData = keyRecord.getPrivateKeyData();

PublicKey publicKey = X509Key.parsePublicKey(new DerValue(publicKeyData));
privateKey = mStorageUnit.unwrap(privateKeyData, publicKey);
privateKey = mStorageUnit.unwrap_temp(privateKeyData, publicKey);
}

} catch (IOException e) {
Expand Down

0 comments on commit 650b00d

Please sign in to comment.