add fallback if security problem is unknown

This commit is contained in:
Vincent Breitmoser
2017-04-24 21:28:43 +02:00
parent 0db22b55e1
commit 1a60c2156d
2 changed files with 9 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.pgp.SecurityProblem.InsecureBitStrength;
import org.sufficientlysecure.keychain.pgp.SecurityProblem.KeySecurityProblem;
import org.sufficientlysecure.keychain.pgp.SecurityProblem.NotWhitelistedCurve;
import org.sufficientlysecure.keychain.pgp.SecurityProblem.UnidentifiedKeyProblem;
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
import org.sufficientlysecure.keychain.ui.widget.KeyHealthPresenter.KeyHealthClickListener;
import org.sufficientlysecure.keychain.ui.widget.KeyHealthPresenter.KeyHealthMvpView;
@@ -173,6 +174,11 @@ public class KeyHealthCardView extends CardView implements KeyHealthMvpView, OnC
String curveName = KeyFormattingUtils.getCurveInfo(getContext(), notWhitelistedCurve.curveOid);
vInsecureProblem.setText(getResources().getString(R.string.key_insecure_unknown_curve_problem, curveName));
vInsecureSolution.setText(R.string.key_insecure_unknown_curve_solution);
} else if (securityProblem instanceof UnidentifiedKeyProblem) {
vInsecureProblem.setText(R.string.key_insecure_unidentified_problem);
vInsecureSolution.setText(R.string.key_insecure_unknown_curve_solution);
} else {
throw new IllegalArgumentException("all subclasses of KeySecurityProblem must be handled!");
}
}

View File

@@ -1861,6 +1861,9 @@
<string name="key_insecure_unknown_curve_problem">"This key uses the <b>%1$s</b> algorithm, which is not whitelisted."</string>
<string name="key_insecure_unknown_curve_solution">"This key can\'t be upgraded. For secure communication, the owner must generate a new key."</string>
<string name="key_insecure_unidentified_problem">"There is an unidentified problem with this key."</string>
<string name="key_insecure_unidentified_solution">"Please submit a bug report."</string>
<string name="key_expiry_text">"This key expired on <b>%1$s</b>."</string>
</resources>