Partially revert "make masterKeyId and subKeyId strictly required in CryptoInputParcel"

We do need empty masterKeyIds for symmetric passphrases, whoops :)
This commit is contained in:
Vincent Breitmoser 2015-05-28 23:14:03 +02:00
parent 2bbb9b9608
commit 4c1ddd7743

View File

@ -21,8 +21,8 @@ public class RequiredInputParcel implements Parcelable {
public final byte[][] mInputHashes; public final byte[][] mInputHashes;
public final int[] mSignAlgos; public final int[] mSignAlgos;
private long mMasterKeyId; private Long mMasterKeyId;
private long mSubKeyId; private Long mSubKeyId;
private RequiredInputParcel(RequiredInputType type, byte[][] inputHashes, private RequiredInputParcel(RequiredInputType type, byte[][] inputHashes,
int[] signAlgos, Date signatureTime, Long masterKeyId, Long subKeyId) { int[] signAlgos, Date signatureTime, Long masterKeyId, Long subKeyId) {
@ -60,8 +60,8 @@ public class RequiredInputParcel implements Parcelable {
} }
mSignatureTime = source.readInt() != 0 ? new Date(source.readLong()) : null; mSignatureTime = source.readInt() != 0 ? new Date(source.readLong()) : null;
mMasterKeyId = source.readLong(); mMasterKeyId = source.readInt() != 0 ? source.readLong() : null;
mSubKeyId = source.readLong(); mSubKeyId = source.readInt() != 0 ? source.readLong() : null;
} }
@ -136,8 +136,18 @@ public class RequiredInputParcel implements Parcelable {
} else { } else {
dest.writeInt(0); dest.writeInt(0);
} }
dest.writeLong(mMasterKeyId); if (mMasterKeyId != null) {
dest.writeLong(mSubKeyId); dest.writeInt(1);
dest.writeLong(mMasterKeyId);
} else {
dest.writeInt(0);
}
if (mSubKeyId != null) {
dest.writeInt(1);
dest.writeLong(mSubKeyId);
} else {
dest.writeInt(0);
}
} }