Greenbone Vulnerability Management Libraries 22.41.0
credentials.c
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2010-2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
10
11#include "credentials.h"
12
13#include "strings.h" /* for gvm_append_text */
14
15#include <string.h>
16
17#undef G_LOG_DOMAIN
21#define G_LOG_DOMAIN "libgvm base"
22
30void
32{
33 g_free (credentials->username);
34 g_free (credentials->password);
35 g_free (credentials->uuid);
36 g_free (credentials->timezone);
37 g_free (credentials->role);
38 g_free (credentials->severity_class);
39 g_free (credentials->jwt);
40 memset (credentials, '\0', sizeof (*credentials));
41}
42
50void
51append_to_credentials_username (credentials_t *credentials, const char *text,
52 gsize length)
53{
54 gvm_append_text (&credentials->username, text, length);
55}
56
64void
65append_to_credentials_password (credentials_t *credentials, const char *text,
66 gsize length)
67{
68 gvm_append_text (&credentials->password, text, length);
69}
void append_to_credentials_username(credentials_t *credentials, const char *text, gsize length)
Append text to the username of a credential pair.
Definition credentials.c:51
void append_to_credentials_password(credentials_t *credentials, const char *text, gsize length)
Append text to the password of a credential pair.
Definition credentials.c:65
void free_credentials(credentials_t *credentials)
Free credentials.
Definition credentials.c:31
Credential pairs and triples.
void gvm_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
Definition strings.c:66
String utilities.
A username password pair.
Definition credentials.h:20
gchar * role
Role of user.
Definition credentials.h:35
gchar * password
Password of user.
Definition credentials.h:23
gchar * jwt
Current JSON web token of user.
Definition credentials.h:41
gchar * timezone
Timezone of user.
Definition credentials.h:27
gchar * username
Login name of user.
Definition credentials.h:21
gchar * uuid
UUID of user.
Definition credentials.h:25
gchar * severity_class
Severity Class setting of user.
Definition credentials.h:31