don't show allowed key list if no key exists, and some minor PgpDecryptVerify changes

This commit is contained in:
Vincent Breitmoser
2015-05-28 02:27:44 +02:00
parent 1fb7477a5a
commit 5c8af1c5a5
13 changed files with 75 additions and 39 deletions

View File

@@ -27,12 +27,19 @@ import org.sufficientlysecure.keychain.util.Passphrase;
public class DecryptVerifyResult extends InputPendingResult {
public static final int RESULT_NO_DATA = RESULT_ERROR + 16;
public static final int RESULT_KEY_DISALLOWED = RESULT_ERROR + 32;
OpenPgpSignatureResult mSignatureResult;
OpenPgpMetadata mDecryptMetadata;
// This holds the charset which was specified in the ascii armor, if specified
// https://tools.ietf.org/html/rfc4880#page56
String mCharset;
public boolean isKeysDisallowed () {
return (mResult & RESULT_KEY_DISALLOWED) == RESULT_KEY_DISALLOWED;
}
public OpenPgpSignatureResult getSignatureResult() {
return mSignatureResult;
}
@@ -57,10 +64,6 @@ public class DecryptVerifyResult extends InputPendingResult {
mCharset = charset;
}
public boolean isPending() {
return (mResult & RESULT_PENDING) == RESULT_PENDING;
}
public DecryptVerifyResult(int result, OperationLog log) {
super(result, log);
}

View File

@@ -590,7 +590,7 @@ public abstract class OperationResult implements Parcelable {
MSG_DC_ERROR_EXTRACT_KEY (LogLevel.ERROR, R.string.msg_dc_error_extract_key),
MSG_DC_ERROR_INTEGRITY_CHECK (LogLevel.ERROR, R.string.msg_dc_error_integrity_check),
MSG_DC_ERROR_INTEGRITY_MISSING (LogLevel.ERROR, R.string.msg_dc_error_integrity_missing),
MSG_DC_ERROR_INVALID_SIGLIST(LogLevel.ERROR, R.string.msg_dc_error_invalid_siglist),
MSG_DC_ERROR_INVALID_DATA (LogLevel.ERROR, R.string.msg_dc_error_invalid_data),
MSG_DC_ERROR_IO (LogLevel.ERROR, R.string.msg_dc_error_io),
MSG_DC_ERROR_NO_DATA (LogLevel.ERROR, R.string.msg_dc_error_no_data),
MSG_DC_ERROR_NO_KEY (LogLevel.ERROR, R.string.msg_dc_error_no_key),