Added /tls revoke

This commit is contained in:
James Booth
2015-09-24 01:06:53 +01:00
parent 8d2c7f1ac0
commit bd42185389
4 changed files with 72 additions and 1 deletions

View File

@@ -198,6 +198,8 @@ cmd_tls(ProfWin *window, const char * const command, gchar **args)
if (curr) {
cons_show("Trusted certificates:");
cons_show("");
} else {
cons_show("No trustes certificates found.");
}
while (curr) {
TLSCertificate *cert = curr->data;
@@ -224,6 +226,18 @@ cmd_tls(ProfWin *window, const char * const command, gchar **args)
}
g_list_free_full(certs, (GDestroyNotify)tlscerts_free);
return TRUE;
} else if (g_strcmp0(args[0], "revoke") == 0) {
if (args[1] == NULL) {
cons_bad_cmd_usage(command);
} else {
gboolean res = tlscerts_revoke(args[1]);
if (res) {
cons_show("Trusted certificate revoked: %s", args[1]);
} else {
cons_show("Could not find certificate: %s", args[0]);
}
}
return TRUE;
} else {
cons_bad_cmd_usage(command);
return TRUE;