Skip to content

Commit d6d4dce

Browse files
udawclaude
andcommitted
Do not log pairing secrets in ExchangeHandler
Remove DEBUG log statements that printed the SRP shared secret K, the HKDF-derived encryption key and the raw M5 auth tag / message data. No logic changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3b750c1 commit d6d4dce

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎CHANGES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# HAP-Java 2.0.9
22
* Fix Set Duration and Remaining Duration characteristics to advertise format `uint32` instead of `int` [#202](https://github.com/hap-java/HAP-Java/issues/202)
3+
* Stop logging the SRP shared secret, derived key and M5 message data during pairing at DEBUG level
34

45
# HAP-Java 2.0.8
56
* Updated bouncy castle to 1.83

‎src/main/java/io/github/hapjava/server/impl/pairing/ExchangeHandler.java‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public ExchangeHandler(byte[] k, HomekitAuthInfo authInfo) {
3131
}
3232

3333
public HttpResponse handle(PairSetupRequest req) throws Exception {
34-
LOGGER.debug("ExchangeHandler: Starting M5 exchange with shared secret K: {}", bytesToHex(k));
35-
3634
HKDFBytesGenerator hkdf = new HKDFBytesGenerator(new SHA512Digest());
3735
hkdf.init(
3836
new HKDFParameters(
@@ -42,15 +40,10 @@ public HttpResponse handle(PairSetupRequest req) throws Exception {
4240
byte[] okm = hkdf_enc_key = new byte[32];
4341
hkdf.generateBytes(okm, 0, 32);
4442

45-
LOGGER.debug("ExchangeHandler: HKDF encryption key: {}", bytesToHex(okm));
46-
4743
return decrypt((ExchangeRequest) req, okm);
4844
}
4945

5046
private HttpResponse decrypt(ExchangeRequest req, byte[] key) throws Exception {
51-
LOGGER.debug("ExchangeHandler: Received AuthTag: {}", bytesToHex(req.getAuthTagData()));
52-
LOGGER.debug("ExchangeHandler: Received MessageData: {}", bytesToHex(req.getMessageData()));
53-
5447
try {
5548
ChachaDecoder chacha = new ChachaDecoder(key, "PS-Msg05".getBytes(StandardCharsets.UTF_8));
5649
byte[] plaintext = chacha.decodeCiphertext(req.getAuthTagData(), req.getMessageData());

0 commit comments

Comments
 (0)