1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 10:03:50 +01:00

sys/net/credman: fix insecure memory wiping

This commit is contained in:
Marian Buschsieweke 2022-09-19 17:22:13 +02:00
parent 0f27ce4ad8
commit a00fb233dc
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -16,9 +16,10 @@
* @author Aiman Ismail <muhammadaimanbin.ismail@haw-hamburg.de> * @author Aiman Ismail <muhammadaimanbin.ismail@haw-hamburg.de>
*/ */
#include "net/credman.h"
#include "mutex.h"
#include "kernel_defines.h" #include "kernel_defines.h"
#include "mutex.h"
#include "net/credman.h"
#include "string_utils.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@ -395,7 +396,7 @@ void credman_delete(credman_tag_t tag, credman_type_t type)
mutex_lock(&_mutex); mutex_lock(&_mutex);
int pos = _find_credential_pos(tag, type, NULL); int pos = _find_credential_pos(tag, type, NULL);
if (pos >= 0) { if (pos >= 0) {
memset(&credentials[pos], 0, sizeof(credman_credential_t)); explicit_bzero(&credentials[pos], sizeof(credman_credential_t));
used--; used--;
} }
mutex_unlock(&_mutex); mutex_unlock(&_mutex);