mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-01-11 13:38:06 -05:00
canonicalize: fix for tests
This commit is contained in:
parent
299570f1b9
commit
cd1511a4e6
@ -599,6 +599,7 @@ public class PgpKeyOperation {
|
|||||||
log.add(LogLevel.ERROR, LogType.MSG_MF_ERROR_ENCODE, indent+1);
|
log.add(LogLevel.ERROR, LogType.MSG_MF_ERROR_ENCODE, indent+1);
|
||||||
return null;
|
return null;
|
||||||
} catch (PGPException e) {
|
} catch (PGPException e) {
|
||||||
|
Log.e(Constants.TAG, "encountered pgp error while modifying key", e);
|
||||||
log.add(LogLevel.ERROR, LogType.MSG_MF_ERROR_PGP, indent+1);
|
log.add(LogLevel.ERROR, LogType.MSG_MF_ERROR_PGP, indent+1);
|
||||||
return null;
|
return null;
|
||||||
} catch (SignatureException e) {
|
} catch (SignatureException e) {
|
||||||
|
@ -229,7 +229,7 @@ public class UncachedKeyRing {
|
|||||||
|
|
||||||
PGPPublicKey modified = masterKey;
|
PGPPublicKey modified = masterKey;
|
||||||
PGPSignature revocation = null;
|
PGPSignature revocation = null;
|
||||||
for (PGPSignature zert : new IterableIterator<PGPSignature>(masterKey.getSignatures())) {
|
for (PGPSignature zert : new IterableIterator<PGPSignature>(masterKey.getKeySignatures())) {
|
||||||
int type = zert.getSignatureType();
|
int type = zert.getSignatureType();
|
||||||
|
|
||||||
// Disregard certifications on user ids, we will deal with those later
|
// Disregard certifications on user ids, we will deal with those later
|
||||||
@ -238,6 +238,10 @@ public class UncachedKeyRing {
|
|||||||
|| type == PGPSignature.CASUAL_CERTIFICATION
|
|| type == PGPSignature.CASUAL_CERTIFICATION
|
||||||
|| type == PGPSignature.POSITIVE_CERTIFICATION
|
|| type == PGPSignature.POSITIVE_CERTIFICATION
|
||||||
|| type == PGPSignature.CERTIFICATION_REVOCATION) {
|
|| type == PGPSignature.CERTIFICATION_REVOCATION) {
|
||||||
|
// These should not be here...
|
||||||
|
log.add(LogLevel.WARN, LogType.MSG_KC_REVOKE_BAD_TYPE_UID, indent);
|
||||||
|
modified = PGPPublicKey.removeCertification(modified, zert);
|
||||||
|
badCerts += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
WrappedSignature cert = new WrappedSignature(zert);
|
WrappedSignature cert = new WrappedSignature(zert);
|
||||||
@ -429,7 +433,7 @@ public class UncachedKeyRing {
|
|||||||
// If no valid certificate (if only a revocation) remains, drop it
|
// If no valid certificate (if only a revocation) remains, drop it
|
||||||
if (selfCert == null && revocation == null) {
|
if (selfCert == null && revocation == null) {
|
||||||
modified = PGPPublicKey.removeCertification(modified, userId);
|
modified = PGPPublicKey.removeCertification(modified, userId);
|
||||||
log.add(LogLevel.ERROR, LogType.MSG_KC_UID_REVOKE_DUP,
|
log.add(LogLevel.ERROR, LogType.MSG_KC_UID_REMOVE,
|
||||||
indent, userId);
|
indent, userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package org.sufficientlysecure.keychain.pgp;
|
package org.sufficientlysecure.keychain.pgp;
|
||||||
|
|
||||||
import org.spongycastle.bcpg.SignatureSubpacketTags;
|
|
||||||
import org.spongycastle.bcpg.sig.KeyFlags;
|
import org.spongycastle.bcpg.sig.KeyFlags;
|
||||||
import org.spongycastle.openpgp.PGPException;
|
|
||||||
import org.spongycastle.openpgp.PGPPublicKey;
|
import org.spongycastle.openpgp.PGPPublicKey;
|
||||||
import org.spongycastle.openpgp.PGPSignature;
|
import org.spongycastle.openpgp.PGPSignature;
|
||||||
import org.spongycastle.openpgp.PGPSignatureSubpacketVector;
|
import org.spongycastle.openpgp.PGPSignatureSubpacketVector;
|
||||||
@ -11,7 +9,6 @@ import org.sufficientlysecure.keychain.Constants;
|
|||||||
import org.sufficientlysecure.keychain.util.IterableIterator;
|
import org.sufficientlysecure.keychain.util.IterableIterator;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import java.security.SignatureException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -202,6 +202,7 @@ public class OperationResultParcel implements Parcelable {
|
|||||||
MSG_KC_REVOKE_BAD_LOCAL (R.string.msg_kc_revoke_bad_local),
|
MSG_KC_REVOKE_BAD_LOCAL (R.string.msg_kc_revoke_bad_local),
|
||||||
MSG_KC_REVOKE_BAD_TIME (R.string.msg_kc_revoke_bad_time),
|
MSG_KC_REVOKE_BAD_TIME (R.string.msg_kc_revoke_bad_time),
|
||||||
MSG_KC_REVOKE_BAD_TYPE (R.string.msg_kc_revoke_bad_type),
|
MSG_KC_REVOKE_BAD_TYPE (R.string.msg_kc_revoke_bad_type),
|
||||||
|
MSG_KC_REVOKE_BAD_TYPE_UID (R.string.msg_kc_revoke_bad_type_uid),
|
||||||
MSG_KC_REVOKE_BAD (R.string.msg_kc_revoke_bad),
|
MSG_KC_REVOKE_BAD (R.string.msg_kc_revoke_bad),
|
||||||
MSG_KC_REVOKE_DUP (R.string.msg_kc_revoke_dup),
|
MSG_KC_REVOKE_DUP (R.string.msg_kc_revoke_dup),
|
||||||
MSG_KC_SUB (R.string.msg_kc_sub),
|
MSG_KC_SUB (R.string.msg_kc_sub),
|
||||||
@ -233,6 +234,7 @@ public class OperationResultParcel implements Parcelable {
|
|||||||
MSG_KC_UID_NO_CERT (R.string.msg_kc_uid_no_cert),
|
MSG_KC_UID_NO_CERT (R.string.msg_kc_uid_no_cert),
|
||||||
MSG_KC_UID_REVOKE_DUP (R.string.msg_kc_uid_revoke_dup),
|
MSG_KC_UID_REVOKE_DUP (R.string.msg_kc_uid_revoke_dup),
|
||||||
MSG_KC_UID_REVOKE_OLD (R.string.msg_kc_uid_revoke_old),
|
MSG_KC_UID_REVOKE_OLD (R.string.msg_kc_uid_revoke_old),
|
||||||
|
MSG_KC_UID_REMOVE (R.string.msg_kc_uid_remove),
|
||||||
|
|
||||||
|
|
||||||
// keyring consolidation
|
// keyring consolidation
|
||||||
|
@ -592,6 +592,7 @@
|
|||||||
<string name="msg_kc_revoke_bad_local">Removing keyring revocation certificate with "local" flag</string>
|
<string name="msg_kc_revoke_bad_local">Removing keyring revocation certificate with "local" flag</string>
|
||||||
<string name="msg_kc_revoke_bad_time">Removing keyring revocation certificate with future timestamp</string>
|
<string name="msg_kc_revoke_bad_time">Removing keyring revocation certificate with future timestamp</string>
|
||||||
<string name="msg_kc_revoke_bad_type">Removing master key certificate of unknown type (%s)</string>
|
<string name="msg_kc_revoke_bad_type">Removing master key certificate of unknown type (%s)</string>
|
||||||
|
<string name="msg_kc_revoke_bad_type_uid">Removing user id certification in bad position</string>
|
||||||
<string name="msg_kc_revoke_bad">Removing bad keyring revocation certificate</string>
|
<string name="msg_kc_revoke_bad">Removing bad keyring revocation certificate</string>
|
||||||
<string name="msg_kc_revoke_dup">Removing redundant keyring revocation certificate</string>
|
<string name="msg_kc_revoke_dup">Removing redundant keyring revocation certificate</string>
|
||||||
<string name="msg_kc_sub">Processing subkey %s</string>
|
<string name="msg_kc_sub">Processing subkey %s</string>
|
||||||
@ -629,6 +630,7 @@
|
|||||||
<string name="msg_kc_uid_revoke_dup">Removing redundant revocation certificate for user id "%s"</string>
|
<string name="msg_kc_uid_revoke_dup">Removing redundant revocation certificate for user id "%s"</string>
|
||||||
<string name="msg_kc_uid_revoke_old">Removing outdated revocation certificate for user id "%s"</string>
|
<string name="msg_kc_uid_revoke_old">Removing outdated revocation certificate for user id "%s"</string>
|
||||||
<string name="msg_kc_uid_no_cert">No valid self-certificate found for user id %s, removing from ring</string>
|
<string name="msg_kc_uid_no_cert">No valid self-certificate found for user id %s, removing from ring</string>
|
||||||
|
<string name="msg_kc_uid_remove">Removing invalid user id %s</string>
|
||||||
|
|
||||||
<!-- Keyring merging log entries -->
|
<!-- Keyring merging log entries -->
|
||||||
<string name="msg_mg_public">Merging into public keyring %s</string>
|
<string name="msg_mg_public">Merging into public keyring %s</string>
|
||||||
|
2
extern/spongycastle
vendored
2
extern/spongycastle
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 968405ee5d4272330cffdf75f7eee4cd9f5c8646
|
Subproject commit c142a844b680652adb751a193a4e4a926a4c080b
|
Loading…
Reference in New Issue
Block a user