mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Set a compile-time limit to X.509 chain length
This commit is contained in:
@ -2185,6 +2185,9 @@
|
||||
/* Debug options */
|
||||
//#define POLARSSL_DEBUG_DFL_MODE POLARSSL_DEBUG_LOG_FULL /**< Default log: Full or Raw */
|
||||
|
||||
/* X509 options */
|
||||
//#define POLARSSL_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */
|
||||
|
||||
/* \} name SECTION: Module configuration options */
|
||||
|
||||
#include "check_config.h"
|
||||
|
@ -45,6 +45,18 @@
|
||||
* \{
|
||||
*/
|
||||
|
||||
#if !defined(POLARSSL_X509_MAX_INTERMEDIATE_CA)
|
||||
/**
|
||||
* Maximum number of intermediate CAs in a verification chain.
|
||||
* That is, maximum length of the chain, excluding the end-entity certificate
|
||||
* and the trusted root certificate.
|
||||
*
|
||||
* Set this to a low value to prevent an adversary from making you waste
|
||||
* resources verifying an overlong certificate chain.
|
||||
*/
|
||||
#define POLARSSL_X509_MAX_INTERMEDIATE_CA 8
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name X509 Error codes
|
||||
* \{
|
||||
|
Reference in New Issue
Block a user