diff --git a/include/crypto_config_structs.h b/include/crypto_config_structs.h index d175bfa5..3ad48826 100644 --- a/include/crypto_config_structs.h +++ b/include/crypto_config_structs.h @@ -58,7 +58,8 @@ typedef enum CRYPTOGRAPHY_TYPE_UNITIALIZED = 0, CRYPTOGRAPHY_TYPE_LIBGCRYPT, CRYPTOGRAPHY_TYPE_KMCCRYPTO, - CRYPTOGRAPHY_TYPE_WOLFSSL + CRYPTOGRAPHY_TYPE_WOLFSSL, + CRYPTOGRAPHY_TYPE_CUSTOM } CryptographyType; /*************************************** ** GVCID Managed Parameter enums diff --git a/include/cryptography_interface.h b/include/cryptography_interface.h index 75457782..93df7ac5 100644 --- a/include/cryptography_interface.h +++ b/include/cryptography_interface.h @@ -87,5 +87,6 @@ typedef struct CryptographyInterface get_cryptography_interface_libgcrypt(void); CryptographyInterface get_cryptography_interface_kmc_crypto_service(void); CryptographyInterface get_cryptography_interface_wolfssl(void); +CryptographyInterface get_cryptography_interface_custom(void); #endif //CRYPTOLIB_CRYPTOGRAPHY_INTERFACE_H diff --git a/src/core/crypto_config.c b/src/core/crypto_config.c index 7dec1c93..4efb6bcc 100644 --- a/src/core/crypto_config.c +++ b/src/core/crypto_config.c @@ -241,6 +241,10 @@ int32_t Crypto_Init(void) cryptography_if = get_cryptography_interface_wolfssl(); } if (cryptography_if == NULL) + { + cryptography_if = get_cryptography_interface_custom(); + } + if (cryptography_if == NULL) { // Note this needs to be the last option in the chain due to addition configuration required if (cryptography_kmc_crypto_config != NULL) { diff --git a/src/crypto/custom_stub/cryptography_interface_custom_stub.template.c b/src/crypto/custom_stub/cryptography_interface_custom_stub.template.c new file mode 100644 index 00000000..681df754 --- /dev/null +++ b/src/crypto/custom_stub/cryptography_interface_custom_stub.template.c @@ -0,0 +1,20 @@ +/* + * Copyright 2021, by the California Institute of Technology. + * ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged. + * Any commercial use must be negotiated with the Office of Technology + * Transfer at the California Institute of Technology. + * + * This software may be subject to U.S. export control laws. By accepting + * this software, the user agrees to comply with all applicable U.S. + * export laws and regulations. User has the responsibility to obtain + * export licenses, or other export authority as may be required before + * exporting such information to foreign countries or providing access to + * foreign persons. + */ + +#include "cryptography_interface.h" + +CryptographyInterface get_cryptography_interface_custom(void) +{ + return NULL; +} \ No newline at end of file