Fix cases of inlined & missing log tags.

This commit is contained in:
Alan Evans
2020-05-11 11:03:42 -03:00
committed by Alex Hart
parent 3db5da1c8d
commit 06ab3cf013
18 changed files with 52 additions and 40 deletions

View File

@@ -119,7 +119,7 @@ public class MasterCipher {
return encryptedAndMacBody;
} catch (GeneralSecurityException ge) {
Log.w("bodycipher", ge);
Log.w(TAG, "bodycipher", ge);
return null;
}

View File

@@ -56,6 +56,8 @@ import javax.crypto.spec.SecretKeySpec;
public class MasterSecretUtil {
private static final String TAG = Log.tag(MasterSecretUtil.class);
public static final String UNENCRYPTED_PASSPHRASE = "unencrypted";
public static final String PREFERENCES_NAME = "SecureSMS-Preferences";
@@ -115,10 +117,10 @@ public class MasterSecretUtil {
return new MasterSecret(new SecretKeySpec(encryptionSecret, "AES"),
new SecretKeySpec(macSecret, "HmacSHA1"));
} catch (GeneralSecurityException e) {
Log.w("keyutil", e);
Log.w(TAG, e);
return null; //XXX
} catch (IOException e) {
Log.w("keyutil", e);
Log.w(TAG, e);
return null; //XXX
}
}
@@ -183,7 +185,7 @@ public class MasterSecretUtil {
return new MasterSecret(new SecretKeySpec(encryptionSecret, "AES"),
new SecretKeySpec(macSecret, "HmacSHA1"));
} catch (GeneralSecurityException e) {
Log.w("keyutil", e);
Log.w(TAG, e);
return null;
}
}
@@ -249,7 +251,7 @@ public class MasterSecretUtil {
SecretKey key = generator.generateKey();
return key.getEncoded();
} catch (NoSuchAlgorithmException ex) {
Log.w("keyutil", ex);
Log.w(TAG, ex);
return null;
}
}
@@ -259,7 +261,7 @@ public class MasterSecretUtil {
KeyGenerator generator = KeyGenerator.getInstance("HmacSHA1");
return generator.generateKey().getEncoded();
} catch (NoSuchAlgorithmException e) {
Log.w("keyutil", e);
Log.w(TAG, e);
return null;
}
}
@@ -290,10 +292,10 @@ public class MasterSecretUtil {
if (scaledIterationTarget < MINIMUM_ITERATION_COUNT) return MINIMUM_ITERATION_COUNT;
else return scaledIterationTarget;
} catch (NoSuchAlgorithmException e) {
Log.w("MasterSecretUtil", e);
Log.w(TAG, e);
return MINIMUM_ITERATION_COUNT;
} catch (InvalidKeySpecException e) {
Log.w("MasterSecretUtil", e);
Log.w(TAG, e);
return MINIMUM_ITERATION_COUNT;
}
}

View File

@@ -88,7 +88,7 @@ public class PublicKey {
MessageDigest md = MessageDigest.getInstance("SHA-1");
return md.digest(serialize());
} catch (NoSuchAlgorithmException nsae) {
Log.w("LocalKeyPair", nsae);
Log.w(TAG, "LocalKeyPair", nsae);
throw new IllegalArgumentException("SHA-1 isn't supported!");
}
}