Commit f56f7e2a authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Fixed private key in refresh certificate mechanism

Change-Id: I194b035966cf9bd0b8eeadf38dac99304b11d607
parent 13c5d423
......@@ -50,7 +50,7 @@ public class RegisterUserFlow {
user.setEthKey(ethKeyPair[1]);
user.setJamiId(DeviceReceiptGenerator.generateJamiId(user));
//Didn't exactly plan on this happening here, but this is the only place we actually need it.
//Given an interface of NameServer, we need to enroll the user or decline the enrollement before
//Given an interface of NameServer, we need to enroll the user or decline the enrollment before
//storing him
NameRegistrationRequest nameRegistrationRequest = new NameRegistrationRequest();
nameRegistrationRequest.setOwner(ethKeyPair[0]);
......
......@@ -69,11 +69,9 @@ public class RegisterDeviceFlow {
}
// Renew user certificate if expired with same private key
if(!user.getCertificate().getNotAfter().after(new Date())) {
user.setX509Fields(new X509Fields());
user.getX509Fields().setCommonName(user.getUsername());
user = UserAuthenticationModule.certificateAuthority.getSignedCertificate(user);
datastore.getUserDao().storeObject(user);
if(user.getCertificate().getNotAfter().after(new Date())) {
user = UserAuthenticationModule.certificateAuthority.getRefreshedCertificate(user);
datastore.updateUserCertificate(user);
}
Device device = new Device();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment