Remember "origin" of gossip keys

This commit is contained in:
Vincent Breitmoser
2018-01-20 22:08:51 +01:00
parent 53953fb058
commit ca8835420d
8 changed files with 46 additions and 21 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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();
}