[riot-notifications] [RIOT-OS/RIOT] sys: add credman (D)TLS credential management module (#11564)

Martine Lenders notifications at github.com
Thu Jul 18 11:36:59 CEST 2019


miri64 commented on this pull request.



> +        goto end;
+    }
+    pos = _find_credential_pos(credential->tag, credential->type);
+    if (pos >= 0) {
+        DEBUG("credman: credential with tag %d and type %d already exist\n",
+              credential->tag, credential->type);
+        ret = CREDMAN_EXIST;
+        goto end;
+    }
+    /* find the next free position in credential pool */
+    pos = _find_credential_pos(CREDMAN_TAG_EMPTY, CREDMAN_TYPE_EMPTY);
+    if (pos < 0) {
+        DEBUG("credman: no space for new credential\n");
+        ret = CREDMAN_NO_SPACE;
+        goto end;
+    }

Though I'm wondering if this

```C
pos = _find_credential_pos(tag, type);
if (check pos condition) {
    throw error;
}
```

duplication might be consolidatable somehow. I had no idea yet though.

-- 
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/11564#pullrequestreview-263539435
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190718/88c575ad/attachment.htm>


More information about the notifications mailing list