From 508a316cbb99e792ccbb3760563063f0219c670c Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Sun, 26 Oct 2014 06:18:05 +0100 Subject: [PATCH] improved OTP logging don't accept empty key file silently --- src/keepass2android/PasswordActivity.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/keepass2android/PasswordActivity.cs b/src/keepass2android/PasswordActivity.cs index 0dc25e57..f963be24 100644 --- a/src/keepass2android/PasswordActivity.cs +++ b/src/keepass2android/PasswordActivity.cs @@ -876,7 +876,7 @@ namespace keepass2android //no need to check for validity of password because if this method is called, the Ok button was enabled (i.e. there was a valid password) CompositeKey compositeKey = new CompositeKey(); compositeKey.AddUserKey(new KcpPassword(_password)); - if ((KeyProviderType == KeyProviders.KeyFile) && (_keyFileOrProvider != "")) + if (KeyProviderType == KeyProviders.KeyFile) { try { @@ -895,11 +895,12 @@ namespace keepass2android try { var lOtps = GetOtpsFromUi(); + Kp2aLog.Log("received " + lOtps.Count + " otps."); OathHotpKeyProv.CreateOtpSecret(lOtps, _otpInfo); } - catch (Exception) + catch (Exception e) { - + Kp2aLog.Log(e.ToString()); Toast.MakeText(this, GetString(Resource.String.OtpKeyError), ToastLength.Long).Show(); return;