Skip to content

TLS 1.3 with PSK Cipher #188

@Smuul

Description

@Smuul

Description:

I am attempting to perform a TLS 1.3 handshake using a PSK cipher (TLS_AES_128_GCM_SHA256), and I’m encountering issues where the OpenSSL client sends an "Unexpected Message" alert after the Finished message sent from TLS-Attacker Server.

Scenario:

TLS-Attacker Server Command:

java -jar apps/TLS-Server.jar -port 4433 -config resources/configs/tls13.config -version TLS13 -workflow_trace_type TLS13_PSK

OpenSSL Server Command:

openssl s_client -tls1_3 -connect 127.0.0.1:4433 -psk 316132623363346435653666 -ciphersuites TLS_AES_128_GCM_SHA256 -keylogfile /tmp/.ssl-key.log -msg -debug

tls13.config

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
    <defaultPSKKey>316132623363346435653666</defaultPSKKey>
    <highestProtocolVersion>TLS13</highestProtocolVersion>
    <defaultClientSupportedSignatureAndHashAlgorithms>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_SHA256</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_SHA384</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_SHA512</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>ECDSA_SHA256</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>ECDSA_SHA384</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>ECDSA_SHA512</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA256</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA384</defaultClientSupportedSignatureAndHashAlgorithm>
        <defaultClientSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA512</defaultClientSupportedSignatureAndHashAlgorithm>
    </defaultClientSupportedSignatureAndHashAlgorithms>
    <defaultClientSupportedCipherSuites>
        <defaultClientSupportedCipherSuite>TLS_AES_128_GCM_SHA256</defaultClientSupportedCipherSuite>
        <defaultClientSupportedCipherSuite>TLS_AES_256_GCM_SHA384</defaultClientSupportedCipherSuite>
    </defaultClientSupportedCipherSuites>
    <defaultServerSupportedCipherSuites>
        <defaultServerSupportedCipherSuite>TLS_AES_128_GCM_SHA256</defaultServerSupportedCipherSuite>
        <defaultServerSupportedCipherSuite>TLS_AES_256_GCM_SHA384</defaultServerSupportedCipherSuite>
    </defaultServerSupportedCipherSuites>
    <defaultClientNamedGroups>
        <defaultClientNamedGroup>ECDH_X25519</defaultClientNamedGroup>
    </defaultClientNamedGroups>
    <defaultServerNamedGroups>
        <defaultServerNamedGroup>ECDH_X25519</defaultServerNamedGroup>
    </defaultServerNamedGroups>
    <supportedVersions>
        <supportedVersion>TLS13</supportedVersion>
    </supportedVersions>
    <defaultSelectedNamedGroup>ECDH_X25519</defaultSelectedNamedGroup>
    <defaultClientKeyShareNamedGroups>
        <defaultClientKeyShareNamedGroup>ECDH_X25519</defaultClientKeyShareNamedGroup>
    </defaultClientKeyShareNamedGroups>
    <addECPointFormatExtension>false</addECPointFormatExtension>
    <addEllipticCurveExtension>true</addEllipticCurveExtension>
    <addSignatureAndHashAlgorithmsExtension>true</addSignatureAndHashAlgorithmsExtension>
    <addSupportedVersionsExtension>true</addSupportedVersionsExtension>
    <addKeyShareExtension>true</addKeyShareExtension>
    <addRenegotiationInfoExtension>false</addRenegotiationInfoExtension>
    <defaultSelectedCipherSuite>TLS_AES_128_GCM_SHA256</defaultSelectedCipherSuite>
    <defaultServerSupportedSignatureAndHashAlgorithms>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_SHA256</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_SHA384</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_SHA512</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>ECDSA_SHA256</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>ECDSA_SHA384</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>ECDSA_SHA512</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA256</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA384</defaultServerSupportedSignatureAndHashAlgorithm>
        <defaultServerSupportedSignatureAndHashAlgorithm>RSA_PSS_RSAE_SHA512</defaultServerSupportedSignatureAndHashAlgorithm>
    </defaultServerSupportedSignatureAndHashAlgorithms>
</config>

Observations:

When the TLS-Attacker Server sends the Finished Message the OpenSSL Client sends an UnexpectedMessage Alert

image

Am I missing something? Any guidance or support would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions