Skip to content

Commit

Permalink
remove null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
JuhaPekkaa committed Oct 30, 2024
1 parent 0768bf3 commit 8a56707
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,11 @@ class DtlsServer(
}

val sslSession = sslConfig.loadSession(cid, sessBuf.sessionBlob, adr)
dtlsPacket.let {
val verificationResult = sslSession.checkRecord(it)
if (verificationResult is SslSession.VerificationResult.Invalid) {
logger.warn("[{}] [CID:{}] Record verification failed: {}", adr, cid.toHex(), verificationResult.message)
reportMessageDrop(adr)
return false
}
val verificationResult = sslSession.checkRecord(dtlsPacket)
if (verificationResult is SslSession.VerificationResult.Invalid) {
logger.warn("[{}] [CID:{}] Record verification failed: {}", adr, cid.toHex(), verificationResult.message)
reportMessageDrop(adr)
return false
}
sessions[adr] = DtlsSession(sslSession, adr, sessBuf.authenticationContext, sessBuf.sessionStartTimestamp)
true
Expand Down

0 comments on commit 8a56707

Please sign in to comment.