Hi Singaravelu,

I tried reproducing the issue, but in my tests when the intermediate CA is revoked by the root CA, the chain is correctly rejected.


Do you see anything the differs in your setup that could explain the discrepancy? In particular, are you using the CA callback with mbedtls_ssl_conf_ca_cb(), or any other certificate related callback (SNI, etc.)?

Also, just to be sure: in order to check the client's certificate chain, the CRL has to be provisioned on the server (and vice-versa).

Can you confirm exactly which certificate-related functions (ssl_conf_ca_chain(), ssl_conf_own_cert(), etc.) you're calling on which side with what arguments?

Thanks,
Manuel.


From: singaravelu Balasubramani via mbed-tls <mbed-tls@lists.trustedfirmware.org>
Sent: 15 February 2024 11:35
To: mbed-tls@lists.trustedfirmware.org <mbed-tls@lists.trustedfirmware.org>
Subject: [mbed-tls] Handshake is successful if the intermediate CA is revoked.
 
I am checking the certificate revocation with below scenario.
I have Root CA, Intermediate CA and device certificate is signed by Intermediate CA.
I am makeing chain certificate by combining Root CA, Intermediate CA and this chain certificate is my active CA certificate and loaded this and device certificate to the drive.

From client,
I am creating client certificate which is signed by same intermeidate CA.

Making ssl handshake. Handshake is success as expected.

Now i am revoking the intermediate CA and creating the crl which is signed by the Root CA. This crl has the serial number of intermediate CA.

Now loading the CRL to the drive and setting the crl in "mbedtls_ssl_conf_ca_chain".

Now i am establishing the ssl connection with the same client ceritificate and expecting the ssl handshake failure due to intermediate CA revoked. But i get handshake is success.

Is my understanding right about intermediate CA revocation?

I did little background debug, and my obervation is
During handshake , it goes to static int x509_crt_verify_chain function in mbedtls.
Its trying to find the parent using x509_crt_find_parent for the client certificate and get intermediate CA. During this time, parent_is_trusted is set as true.
after this x509_crt_verifycrl is called with client certificate (child), intermediate CA (parent) and crl(has the intermediate CA serial number-issued by Root CA).
During x509_crt_verifycrl check, it check for CRL issuer with ca subject and return 0, as its not matching. now in x509_crt_verify_chain ,    /* prepare for next iteration */ ., they are marking child_is_trusted = parent_is_trusted and child = parent, parent = NULL; and while loop continues, in loop, x509_crt_verify_chain checks for child_is_trusted is true and return as 0.
But its not checking that intermediate CA is revoked or not.
        /* Stop here for trusted roots (but not for trusted EE certs) */
        if( child_is_trusted )
            return( 0 );
--
mbed-tls mailing list -- mbed-tls@lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-leave@lists.trustedfirmware.org