[riot-notifications] [RIOT-OS/RIOT] sys/credman: add key load functions (#16263)

Aiman Ismail notifications at github.com
Tue Apr 6 16:12:59 CEST 2021


@pokgak commented on this pull request.



> +
+    /* point to privateKey */
+    node = node->next;
+    if (!node || node->type != ASN1_TYPE_OCTET_STRING || !node->data || !node->length) {
+        DEBUG("credman: invalid private key\n");
+        return CREDMAN_INVALID;
+    }
+
+    cred->type = CREDMAN_TYPE_ECDSA;
+    cred->params.ecdsa.public_key.x = NULL;
+    cred->params.ecdsa.public_key.y = NULL;
+
+    cred->params.ecdsa.private_key = node->data;
+
+    /* try to find a publicKey by tag */
+    while (node && node->type != 0xA1) {

A macro to document it would definitely be better especially since this code is not touched much and it will make it easier for the next person to understand what is done.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16263#discussion_r607886870
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210406/f10f5a38/attachment.htm>


More information about the notifications mailing list