Remove certificate validation code from ViewCertActivity, they are already validated by import

This commit is contained in:
Dominik Schürmann 2014-09-19 11:46:21 +02:00
parent a454bfd701
commit 99bf77dd84
3 changed files with 3 additions and 49 deletions

View File

@ -85,7 +85,6 @@ public class ViewCertActivity extends ActionBarActivity
setContentView(R.layout.view_cert_activity);
mStatus = (TextView) findViewById(R.id.status);
mSigneeKey = (TextView) findViewById(R.id.signee_key);
mSigneeUid = (TextView) findViewById(R.id.signee_uid);
mAlgorithm = (TextView) findViewById(R.id.algorithm);
@ -141,31 +140,6 @@ public class ViewCertActivity extends ActionBarActivity
}
WrappedSignature sig = WrappedSignature.fromBytes(data.getBlob(INDEX_DATA));
try {
ProviderHelper providerHelper = new ProviderHelper(this);
CanonicalizedPublicKeyRing signeeRing =
providerHelper.getCanonicalizedPublicKeyRing(data.getLong(INDEX_MASTER_KEY_ID));
CanonicalizedPublicKeyRing signerRing =
providerHelper.getCanonicalizedPublicKeyRing(sig.getKeyId());
try {
sig.init(signerRing.getPublicKey());
if (sig.verifySignature(signeeRing.getPublicKey(), signeeUid)) {
mStatus.setText(R.string.cert_verify_ok);
mStatus.setTextColor(getResources().getColor(R.color.android_green_light));
} else {
mStatus.setText(R.string.cert_verify_failed);
mStatus.setTextColor(getResources().getColor(R.color.alert));
}
} catch (PgpGeneralException e) {
mStatus.setText(R.string.cert_verify_error);
mStatus.setTextColor(getResources().getColor(R.color.alert));
}
} catch (ProviderHelper.NotFoundException e) {
mStatus.setText(R.string.cert_verify_unavailable);
mStatus.setTextColor(getResources().getColor(R.color.black));
}
String algorithmStr = KeyFormattingUtils.getAlgorithmInfo(this, sig.getKeyAlgorithm(), null, null);
mAlgorithm.setText(algorithmStr);

View File

@ -13,26 +13,6 @@
android:paddingLeft="16dp"
android:paddingRight="16dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="14dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_verify_status" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cert_verify_ok"
android:id="@+id/status"
android:layout_marginLeft="30dp" />
</LinearLayout>
<TextView
style="@style/SectionHeader"
android:layout_width="wrap_content"

View File

@ -762,7 +762,7 @@
<string name="msg_con_warn_delete_secret">"Exception deleting secret cache file"</string>
<!-- Other messages used in OperationLogs -->
<string name="msg_ek_error_divert">"Editing of nfc keys is not (yet) supported!"</string>
<string name="msg_ek_error_divert">"Editing of NFC keys is not (yet) supported!"</string>
<string name="msg_ek_error_dummy">"Cannot edit keyring with stripped master key!"</string>
<string name="msg_ek_error_not_found">"Key not found!"</string>
@ -789,7 +789,7 @@
<string name="msg_dc_error_no_data">"No encrypted data found in stream!"</string>
<string name="msg_dc_error_no_key">"No encrypted data with known secret key found in stream!"</string>
<string name="msg_dc_error_pgp_exception">"Encountered PGP Exception during operation!"</string>
<string name="msg_dc_integrity_check_ok">"Integrity check ok!"</string>
<string name="msg_dc_integrity_check_ok">"Integrity check OK!"</string>
<string name="msg_dc_ok_meta_only">"Only metadata was requested, skipping decryption"</string>
<string name="msg_dc_ok">"OK"</string>
<string name="msg_dc_pass_cached">"Using passphrase from cache"</string>
@ -847,7 +847,7 @@
<string name="label_user_id">"Identity"</string>
<string name="unknown_uid">"&lt;unknown&gt;"</string>
<string name="empty_certs">"No certificates for this key"</string>
<string name="certs_text">"Only self-certificates and certificates created with your keys are displayed here."</string>
<string name="certs_text">"Only validated self-certificates and validated certificates created with your keys are displayed here."</string>
<string name="section_uids_to_certify">"Identities to certify"</string>
<string name="label_revocation">"Revocation Reason"</string>
<string name="label_verify_status">"Verification Status"</string>