allow explicit re-certification in SaveKeyringParcel

This commit is contained in:
Vincent Breitmoser 2015-01-24 23:11:54 +01:00
parent 0e0970c347
commit fb2fa195bf
3 changed files with 10 additions and 2 deletions

View File

@ -659,7 +659,8 @@ public class PgpKeyOperationTest {
{ // re-add second subkey { // re-add second subkey
parcel.reset(); parcel.reset();
parcel.mChangeSubKeys.add(new SubkeyChange(keyId, null, null)); // re-certify the revoked subkey
parcel.mChangeSubKeys.add(new SubkeyChange(keyId, true));
modified = applyModificationWithChecks(parcel, modified, onlyA, onlyB); modified = applyModificationWithChecks(parcel, modified, onlyA, onlyB);

View File

@ -730,7 +730,7 @@ public class PgpKeyOperation {
} }
// This doesn't concern us any further // This doesn't concern us any further
if (change.mExpiry == null && change.mFlags == null) { if (!change.mRecertify && (change.mExpiry == null && change.mFlags == null)) {
continue; continue;
} }

View File

@ -118,11 +118,18 @@ public class SaveKeyringParcel implements Parcelable {
public boolean mDummyStrip; public boolean mDummyStrip;
// if this flag is true, the subkey should be changed to a divert-to-card key // if this flag is true, the subkey should be changed to a divert-to-card key
public boolean mDummyDivert; public boolean mDummyDivert;
// if this flag is true, the key will be recertified even if the above values are no-ops
public boolean mRecertify;
public SubkeyChange(long keyId) { public SubkeyChange(long keyId) {
mKeyId = keyId; mKeyId = keyId;
} }
public SubkeyChange(long keyId, boolean recertify) {
mKeyId = keyId;
mRecertify = recertify;
}
public SubkeyChange(long keyId, Integer flags, Long expiry) { public SubkeyChange(long keyId, Integer flags, Long expiry) {
mKeyId = keyId; mKeyId = keyId;
mFlags = flags; mFlags = flags;