GVM: Utilities for LSC credential package generation.
More...
#include <glib.h>
#include <glib/gstdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <gvm/util/fileutils.h>
|
static int | create_ssh_key (const char *comment, const char *passphrase, const char *privpath) |
| Create an ssh key for local security checks. More...
|
|
int | lsc_user_keys_create (const gchar *password, gchar **private_key) |
| Create local security check (LSC) keys. More...
|
|
static gboolean | lsc_user_rpm_create (const gchar *username, const gchar *public_key_path, const gchar *to_filename) |
| Attempts creation of RPM packages to create a user and install a. More...
|
|
int | lsc_user_rpm_recreate (const gchar *name, const char *public_key, void **rpm, gsize *rpm_size) |
| Recreate RPM package. More...
|
|
static gboolean | lsc_user_deb_create (const gchar *username, const gchar *public_key_path, const gchar *to_filename, const gchar *maintainer) |
| Attempts creation of Debian packages to create a user and install a. More...
|
|
int | lsc_user_deb_recreate (const gchar *name, const char *public_key, const char *maintainer, void **deb, gsize *deb_size) |
| Recreate DEB package. More...
|
|
static gboolean | lsc_user_exe_create (const gchar *username, const gchar *password, const gchar *to_filename) |
| Create a Windows EXE installer for adding a user. More...
|
|
int | lsc_user_exe_recreate (const gchar *name, const gchar *password, void **exe, gsize *exe_size) |
| Recreate NSIS package. More...
|
|
GVM: Utilities for LSC credential package generation.
This file provides support for generating packages for LSC credentials.
◆ create_ssh_key()
static int create_ssh_key |
( |
const char * |
comment, |
|
|
const char * |
passphrase, |
|
|
const char * |
privpath |
|
) |
| |
|
static |
Create an ssh key for local security checks.
Forks and creates a key for local checks by calling 'ssh-keygen -t rsa -f filepath -C "comment" -P "passhprase"'. A directory will be created if it does not exist.
- Parameters
-
[in] | comment | Comment to use. |
[in] | passphrase | Passphrase for key, must be longer than 4 characters. |
[in] | privpath | Filename of the key file. |
- Returns
- 0 if successful, -1 otherwise.
◆ lsc_user_deb_create()
static gboolean lsc_user_deb_create |
( |
const gchar * |
username, |
|
|
const gchar * |
public_key_path, |
|
|
const gchar * |
to_filename, |
|
|
const gchar * |
maintainer |
|
) |
| |
|
static |
Attempts creation of Debian packages to create a user and install a.
public key file for it.
- Parameters
-
[in] | username | Name of user. |
[in] | public_key_path | Location of public key. |
[in] | to_filename | Destination filename for RPM. |
[in] | maintainer | Maintainer email address. |
- Returns
- Path to rpm file if successful, NULL otherwise.
◆ lsc_user_deb_recreate()
int lsc_user_deb_recreate |
( |
const gchar * |
name, |
|
|
const char * |
public_key, |
|
|
const char * |
maintainer, |
|
|
void ** |
deb, |
|
|
gsize * |
deb_size |
|
) |
| |
Recreate DEB package.
- Parameters
-
[in] | name | User name. |
[in] | public_key | Public key. |
[in] | maintainer | The maintainer email address. |
[out] | deb | DEB package. |
[out] | deb_size | Size of DEB package, in bytes. |
- Returns
- 0 success, -1 error.
◆ lsc_user_exe_create()
static gboolean lsc_user_exe_create |
( |
const gchar * |
username, |
|
|
const gchar * |
password, |
|
|
const gchar * |
to_filename |
|
) |
| |
|
static |
Create a Windows EXE installer for adding a user.
- Parameters
-
[in] | username | Name of user. |
[in] | password | Password of user. |
[in] | to_filename | Destination filename for package. |
- Returns
- 0 success, -1 error.
◆ lsc_user_exe_recreate()
int lsc_user_exe_recreate |
( |
const gchar * |
name, |
|
|
const gchar * |
password, |
|
|
void ** |
exe, |
|
|
gsize * |
exe_size |
|
) |
| |
Recreate NSIS package.
- Parameters
-
[in] | name | User name. |
[in] | password | Password. |
[out] | exe | NSIS package. |
[out] | exe_size | Size of NSIS package, in bytes. |
- Returns
- 0 success, -1 error.
◆ lsc_user_keys_create()
int lsc_user_keys_create |
( |
const gchar * |
password, |
|
|
gchar ** |
private_key |
|
) |
| |
Create local security check (LSC) keys.
- Parameters
-
[in] | password | Password. |
[out] | private_key | Private key. |
- Returns
- 0 success, -1 error.
◆ lsc_user_rpm_create()
static gboolean lsc_user_rpm_create |
( |
const gchar * |
username, |
|
|
const gchar * |
public_key_path, |
|
|
const gchar * |
to_filename |
|
) |
| |
|
static |
Attempts creation of RPM packages to create a user and install a.
public key file for it.
- Parameters
-
[in] | username | Name of user. |
[in] | public_key_path | Location of public key. |
[in] | to_filename | Destination filename for RPM. |
- Returns
- Path to rpm file if successful, NULL otherwise.
◆ lsc_user_rpm_recreate()
int lsc_user_rpm_recreate |
( |
const gchar * |
name, |
|
|
const char * |
public_key, |
|
|
void ** |
rpm, |
|
|
gsize * |
rpm_size |
|
) |
| |
Recreate RPM package.
- Parameters
-
[in] | name | User name. |
[in] | public_key | Public key. |
[out] | rpm | RPM package. |
[out] | rpm_size | Size of RPM package, in bytes. |
- Returns
- 0 success, -1 error.