GoogleCloudPlatform / iot-device-sdk-embedded-c

Cloud IoT Device SDK for Connectivity to IoT Core.
Other
247 stars 83 forks source link

iotc_create_iotcore_jwt returned with error: 71l #124

Closed tomascharad closed 3 years ago

tomascharad commented 3 years ago

Hi!

I'm trying to implement iotc_create_iotcore_jwt, but when calling it I receive the following error:

iotc_create_iotcore_jwt returned with error: 71l

¿Could you give me some lights on what I could be doing wrong?

I'm trying to follow this example: https://github.com/GoogleCloudPlatform/iot-device-sdk-embedded-c/blob/master/examples/zephyr_native_posix/src/main.c#L86

tomascharad commented 3 years ago

Hi!,

So I've debugged the code completely, and I got here:

https://googlecloudplatform.github.io/iot-device-sdk-embedded-c/bsp/html/d6/d01/iotc__bsp__crypto_8h.html#a373aca3a308916b2a8d31a3dbb773401a8648c2163ca7200e5b58a30123a897ff

When executing this code image

Can't create ECC signature

Do you know what can be happening?

Many thanks!

tomascharad commented 3 years ago

The output of the function is -20096

Which I think si this error

image

tomascharad commented 3 years ago

Solved by changing the keys to elliptic curves.