Remember "origin" of gossip keys
This commit is contained in:
@@ -94,7 +94,7 @@ class AutocryptInteractor {
|
||||
// 4. Set peers[gossip-addr].gossip_key to the value of the keydata attribute.
|
||||
Long newMasterKeyId = saveKeyringResult.savedMasterKeyId;
|
||||
|
||||
autocryptPeerDao.updateKeyGossip(autocryptPeerId, effectiveDate, newMasterKeyId);
|
||||
autocryptPeerDao.updateKeyGossipFromAutocrypt(autocryptPeerId, effectiveDate, newMasterKeyId);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -577,13 +577,12 @@ public class OpenPgpService extends Service {
|
||||
|
||||
long masterKeyId = signatureResult.getKeyId();
|
||||
if (autocryptPeerMasterKeyId == null) {
|
||||
// TODO
|
||||
// Date now = new Date();
|
||||
// Date effectiveTime = signatureResult.getSignatureTimestamp();
|
||||
// if (effectiveTime.after(now)) {
|
||||
// effectiveTime = now;
|
||||
// }
|
||||
// autocryptPeerentityDao.updateKeyGossip(autocryptPeerId, effectiveTime, masterKeyId);
|
||||
Date now = new Date();
|
||||
Date effectiveTime = signatureResult.getSignatureTimestamp();
|
||||
if (effectiveTime.after(now)) {
|
||||
effectiveTime = now;
|
||||
}
|
||||
autocryptPeerentityDao.updateKeyGossipFromSignature(autocryptPeerId, effectiveTime, masterKeyId);
|
||||
return signatureResult.withAutocryptPeerResult(AutocryptPeerResult.NEW);
|
||||
} else if (masterKeyId == autocryptPeerMasterKeyId) {
|
||||
return signatureResult.withAutocryptPeerResult(AutocryptPeerResult.OK);
|
||||
|
||||
@@ -122,7 +122,7 @@ class RemoteDeduplicatePresenter implements LoaderCallbacks<List<KeyInfo>> {
|
||||
}
|
||||
|
||||
long masterKeyId = keyInfoData.get(selectedItem).getMasterKeyId();
|
||||
autocryptPeerDao.updateKeyGossip(duplicateAddress, new Date(), masterKeyId);
|
||||
autocryptPeerDao.updateKeyGossipFromDedup(duplicateAddress, new Date(), masterKeyId);
|
||||
|
||||
view.finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user