Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

243 custom crypto module #253

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/crypto_config_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/cryptography_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions src/core/crypto_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Loading