Dear All,

 

I am having multiple queries regarding session resumption and renegotiation.

I understand that normally session resumption is used at every new connection and session renegotiation is used on live connection.

 

Our domain standards recommends to use session resumption to change session key ( or keyblock

key_block = PRF(SecurityParameters.master_secret,

                      "key expansion",

                      SecurityParameters.server_random +

                      SecurityParameters.client_random);

at regular intervals without closing connection and session renegotiation to change master key at regular interval using session renegotiation. This is due to the fact that the connection will be long lasting.

 

Query 1:

I understand that mbedtls currently does not support session resumption on live connection. Is there any plan to include it in the near future? ( may be similar to openssl SSL_renegotiate_abbreviated api)

 

Query 3:

If the application wants to know if session renegotiation has happened as part of mbedtls_tls_read and mbedtls_tls_write, is there any callback/API for that?

--> I am only thinking of using session->start comparison in application to know if session is renegotiated. Is there any better method?

                                                                                                                                                

Query 4:

Our requirement is to understand and log security event in case failure due to certificate verification fail (revoked/expired etc..) currently we use mbedtls_ssl_get_verify_result api for same


There is a case when certificate becomes expired/revoked while doing session renegotiation, mbedtls_ssl_get_verify_result api returns value 0 in above case

 

I am thinking in case of session renegotiation, a valid session will always be available (it will not be NULL in the method below) and session renegotiation failure information will be available with session_negotiate pointer instead of session pointer in the below function.

 

uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl )

{

    if( ssl->session != NULL )

        return( ssl->session->verify_result );

 

    if( ssl->session_negotiate != NULL )

        return( ssl->session_negotiate->verify_result );

 

    return( 0xFFFFFFFF );

}

 

Am I using the right API to get certificate verify_result?

 

should mbedtls_ssl_get_verify_result api checks give priority to session_negotiate then session? I think when there is a failure, the result will always be with session_negotiate, when success session_negotiate becomes NULL and session_negotiate pointers will be assigned to session pointers.

 

uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl )

{

    if( ssl->session_negotiate != NULL )

        return( ssl->session_negotiate->verify_result );

 

    if( ssl->session != NULL )

        return( ssl->session->verify_result );

 

    return( 0xFFFFFFFF );

}

 

Kind request to guide me

 

Thanks in advance

 

Regards

Hardik Dave