Skip to content

Commit 27214ad

Browse files
committed
Use HMAC-SHA256 for uid signature instead of HMAC-SHA1 (action required: go to Pushpad project settings and change the algorithm)
1 parent 92c078c commit 27214ad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/xyz/pushpad/Pushpad.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public Pushpad(String authToken, String projectId) {
1717
}
1818

1919
public String signatureFor(String data) {
20-
SecretKeySpec signingKey = new SecretKeySpec(this.authToken.getBytes(), "HmacSHA1");
20+
SecretKeySpec signingKey = new SecretKeySpec(this.authToken.getBytes(), "HmacSHA256");
2121
String encoded = null;
2222
try {
23-
Mac mac = Mac.getInstance("HmacSHA1");
23+
Mac mac = Mac.getInstance("HmacSHA256");
2424
mac.init(signingKey);
2525
byte[] rawHmac = mac.doFinal(data.getBytes());
2626
encoded = DatatypeConverter.printHexBinary(rawHmac).toLowerCase();

0 commit comments

Comments
 (0)