From a9268421d79b30c9af5be12d2d902abcd363a60b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 11 Mar 2019 03:24:32 +0100 Subject: implementing private key deletion (#5536) --- src/exchangedb/exchangedb_signkeys.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/exchangedb_signkeys.c') diff --git a/src/exchangedb/exchangedb_signkeys.c b/src/exchangedb/exchangedb_signkeys.c index 3c9f1630a..cb16ee49d 100644 --- a/src/exchangedb/exchangedb_signkeys.c +++ b/src/exchangedb/exchangedb_signkeys.c @@ -76,8 +76,16 @@ signkeys_iterate_dir_iter (void *cls, if (0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh (issue.issue.expire)).rel_value_us) { - /* FIXME: #5536: we should delete this file, the - private key is no longer needed (and return SYSERR!) */ + if (0 != UNLINK (filename)) + { + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, + "unlink", + filename); + return GNUNET_OK; /* yes, we had an error, but continue to iterate anyway */ + } + /* Expired file deleted, continue to iterate -without- calling iterator + as this key is expired */ + return GNUNET_OK; } return skc->it (skc->it_cls, filename, -- cgit v1.2.3