Skip to content

Commit

Permalink
Add supports all Arduino devices except for AVR.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Aug 13, 2023
1 parent 03108c3 commit a41763c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/GS_Const.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,12 @@ struct gauth_token_signer_resources_t
MB_String pk;
size_t hashSize = 32; // SHA256 size (256 bits or 32 bytes)
size_t signatureSize = 256;
#if defined(ESP32)
uint8_t *hash = nullptr;
#elif defined(ESP8266) || defined(MB_ARDUINO_PICO)
char *hash = nullptr;
#endif
unsigned char *signature = nullptr;
MB_String encHeader;
MB_String encPayload;
MB_String encHeadPayload;
MB_String encSignature;
#if defined(ESP32)
mbedtls_pk_context *pk_ctx = nullptr;
mbedtls_entropy_context *entropy_ctx = nullptr;
mbedtls_ctr_drbg_context *ctr_drbg_ctx = nullptr;
#endif
gauth_auth_token_info_t tokens;
};

Expand Down
6 changes: 3 additions & 3 deletions src/auth/GAuthManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,13 +862,13 @@ bool GAuthManager::createJWT()
config->signer.tokens.status = token_status_on_signing;

// RSA private key
BearSSL::PrivateKey *pk = nullptr;
PrivateKey *pk = nullptr;
Utils::idle();
// parse priv key
if (config->signer.pk.length() > 0)
pk = new BearSSL::PrivateKey((const char *)config->signer.pk.c_str());
pk = new PrivateKey((const char *)config->signer.pk.c_str());
else if (strlen_P(config->service_account.data.private_key) > 0)
pk = new BearSSL::PrivateKey((const char *)config->service_account.data.private_key);
pk = new PrivateKey((const char *)config->service_account.data.private_key);

if (!pk)
{
Expand Down

0 comments on commit a41763c

Please sign in to comment.