8235311: Tag mismatch may alert bad_record_mac
Reviewed-by: mullan
This commit is contained in:
parent
02039fd33a
commit
3ba75a656a
@ -28,6 +28,7 @@ package sun.security.ssl;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import javax.crypto.AEADBadTagException;
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
|
||||
@ -116,6 +117,8 @@ interface SSLTransport {
|
||||
}
|
||||
|
||||
throw context.fatal(Alert.UNEXPECTED_MESSAGE, unsoe);
|
||||
} catch (AEADBadTagException bte) {
|
||||
throw context.fatal(Alert.BAD_RECORD_MAC, bte);
|
||||
} catch (BadPaddingException bpe) {
|
||||
/*
|
||||
* The basic SSLv3 record protection involves (optional)
|
||||
@ -123,9 +126,9 @@ interface SSLTransport {
|
||||
* data origin authentication. We do them both here, and
|
||||
* throw a fatal alert if the integrity check fails.
|
||||
*/
|
||||
Alert alert = (context.handshakeContext != null) ?
|
||||
Alert.HANDSHAKE_FAILURE :
|
||||
Alert.BAD_RECORD_MAC;
|
||||
Alert alert = (context.handshakeContext != null) ?
|
||||
Alert.HANDSHAKE_FAILURE :
|
||||
Alert.BAD_RECORD_MAC;
|
||||
throw context.fatal(alert, bpe);
|
||||
} catch (SSLHandshakeException she) {
|
||||
// may be record sequence number overflow
|
||||
|
Loading…
Reference in New Issue
Block a user