mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-25 00:18:51 -05:00
parent
cce243299a
commit
da131220aa
@ -413,7 +413,8 @@ public class PgpKeyOperation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if this is~ the/a primary user id
|
// if this is~ the/a primary user id
|
||||||
if (currentCert.hasSubpackets() && currentCert.getHashedSubPackets().isPrimaryUserID()) {
|
if (currentCert.getHashedSubPackets() != null
|
||||||
|
&& currentCert.getHashedSubPackets().isPrimaryUserID()) {
|
||||||
// if it's the one we want, just leave it as is
|
// if it's the one we want, just leave it as is
|
||||||
if (userId.equals(saveParcel.mChangePrimaryUserId)) {
|
if (userId.equals(saveParcel.mChangePrimaryUserId)) {
|
||||||
ok = true;
|
ok = true;
|
||||||
@ -740,7 +741,7 @@ public class PgpKeyOperation {
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
for(PGPSignature sig : new IterableIterator<PGPSignature>(key.getSignatures())) {
|
for(PGPSignature sig : new IterableIterator<PGPSignature>(key.getSignatures())) {
|
||||||
if (!sig.hasSubpackets()) {
|
if (sig.getHashedSubPackets() == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags |= sig.getHashedSubPackets().getKeyFlags();
|
flags |= sig.getHashedSubPackets().getKeyFlags();
|
||||||
|
@ -513,7 +513,8 @@ public class UncachedKeyRing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if this certificate says it allows signing for the key
|
// if this certificate says it allows signing for the key
|
||||||
if (zert.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.KEY_FLAGS)) {
|
if (zert.getHashedSubPackets() != null &&
|
||||||
|
zert.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.KEY_FLAGS)) {
|
||||||
|
|
||||||
int flags = ((KeyFlags) zert.getHashedSubPackets()
|
int flags = ((KeyFlags) zert.getHashedSubPackets()
|
||||||
.getSubpacket(SignatureSubpacketTags.KEY_FLAGS)).getFlags();
|
.getSubpacket(SignatureSubpacketTags.KEY_FLAGS)).getFlags();
|
||||||
|
@ -63,13 +63,17 @@ public class WrappedSignature {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
PGPSignatureList list;
|
PGPSignatureList list;
|
||||||
list = mSig.getHashedSubPackets().getEmbeddedSignatures();
|
if (mSig.getHashedSubPackets() != null) {
|
||||||
for(int i = 0; i < list.size(); i++) {
|
list = mSig.getHashedSubPackets().getEmbeddedSignatures();
|
||||||
sigs.add(new WrappedSignature(list.get(i)));
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
sigs.add(new WrappedSignature(list.get(i)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
list = mSig.getUnhashedSubPackets().getEmbeddedSignatures();
|
if (mSig.getUnhashedSubPackets() != null) {
|
||||||
for(int i = 0; i < list.size(); i++) {
|
list = mSig.getUnhashedSubPackets().getEmbeddedSignatures();
|
||||||
sigs.add(new WrappedSignature(list.get(i)));
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
sigs.add(new WrappedSignature(list.get(i)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (PGPException e) {
|
} catch (PGPException e) {
|
||||||
// no matter
|
// no matter
|
||||||
@ -97,6 +101,9 @@ public class WrappedSignature {
|
|||||||
if(!isRevocation()) {
|
if(!isRevocation()) {
|
||||||
throw new PgpGeneralException("Not a revocation signature.");
|
throw new PgpGeneralException("Not a revocation signature.");
|
||||||
}
|
}
|
||||||
|
if (mSig.getHashedSubPackets() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
SignatureSubpacket p = mSig.getHashedSubPackets().getSubpacket(
|
SignatureSubpacket p = mSig.getHashedSubPackets().getSubpacket(
|
||||||
SignatureSubpacketTags.REVOCATION_REASON);
|
SignatureSubpacketTags.REVOCATION_REASON);
|
||||||
// For some reason, this is missing in SignatureSubpacketInputStream:146
|
// For some reason, this is missing in SignatureSubpacketInputStream:146
|
||||||
@ -205,7 +212,7 @@ public class WrappedSignature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocal() {
|
public boolean isLocal() {
|
||||||
if (!mSig.hasSubpackets()
|
if (mSig.getHashedSubPackets() == null
|
||||||
|| !mSig.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.EXPORTABLE)) {
|
|| !mSig.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.EXPORTABLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user