Skip to content

Commit 0197262

Browse files
authored
Merge pull request #292 from Iscle/cleanup
Removed redundant calls to getInstance()
2 parents c2324eb + 105f850 commit 0197262

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

lib/src/main/java/xyz/gianlu/librespot/ZeroconfServer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,10 @@ private void handleAddUser(OutputStream out, Map<String, String> params, String
291291
hmac.update("checksum".getBytes());
292292
byte[] checksumKey = hmac.doFinal();
293293

294-
hmac = Mac.getInstance("HmacSHA1");
295294
hmac.init(new SecretKeySpec(baseKey, "HmacSHA1"));
296295
hmac.update("encryption".getBytes());
297296
byte[] encryptionKey = hmac.doFinal();
298297

299-
hmac = Mac.getInstance("HmacSHA1");
300298
hmac.init(new SecretKeySpec(checksumKey, "HmacSHA1"));
301299
hmac.update(encrypted);
302300
byte[] mac = hmac.doFinal();

lib/src/main/java/xyz/gianlu/librespot/core/Session.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ private void connect() throws IOException, GeneralSecurityException, SpotifyAuth
262262
}
263263

264264
byte[] dataArray = data.toByteArray();
265-
mac = Mac.getInstance("HmacSHA1");
266265
mac.init(new SecretKeySpec(Arrays.copyOfRange(dataArray, 0, 0x14), "HmacSHA1"));
267266
mac.update(acc.array());
268267

0 commit comments

Comments
 (0)