OpenVAS Manager
7.0.3~git
|
#include <glib.h>
Go to the source code of this file.
Typedefs | |
typedef struct lsc_crypt_ctx_s * | lsc_crypt_ctx_t |
Functions | |
lsc_crypt_ctx_t | lsc_crypt_new () |
Return a new context for LSC encryption. More... | |
void | lsc_crypt_release (lsc_crypt_ctx_t) |
Release an LSC encryption context. More... | |
int | lsc_crypt_create_key () |
Create the standard credential encryption key. More... | |
void | lsc_crypt_flush (lsc_crypt_ctx_t) |
Flush an LSC encryption context. More... | |
char * | lsc_crypt_encrypt (lsc_crypt_ctx_t, const char *,...) G_GNUC_NULL_TERMINATED |
Encrypt a list of name/value pairs. More... | |
const char * | lsc_crypt_decrypt (lsc_crypt_ctx_t, const char *, const char *) |
Return an encrypted value in the clear. More... | |
const char * | lsc_crypt_get_password (lsc_crypt_ctx_t, const char *) |
Return an encrypted password in the clear. More... | |
const char * | lsc_crypt_get_private_key (lsc_crypt_ctx_t, const char *) |
Return an encrypted private key in the clear. More... | |
Variables | |
int | disable_encrypted_credentials |
Flag indicating that encrypted credentials are disabled. More... | |
typedef struct lsc_crypt_ctx_s* lsc_crypt_ctx_t |
Definition at line 36 of file lsc_crypt.h.
int lsc_crypt_create_key | ( | ) |
Create the standard credential encryption key.
This function creates a standard encryption key if such a key does not yet exists. Note, that in general an encryption key is created on-the-fly.
Definition at line 549 of file lsc_crypt.c.
References lsc_crypt_new().
const char* lsc_crypt_decrypt | ( | lsc_crypt_ctx_t | ctx, |
const char * | ciphertext, | ||
const char * | name | ||
) |
Return an encrypted value in the clear.
This function returns the encrypted value in the clear. The clear value may also be NULL , if no value is available. If a decryption has not yet been done, the passed ciphertext value is first decrypted. Thus a changed value of ciphertext may not have an effect. To force a decryption a call to lsc_crypt_flush is required.
[in] | ctx | The context |
[in] | ciphertext | The base64 encoded ciphertext. |
[in] | name | Name of the value to get. |
Definition at line 693 of file lsc_crypt.c.
References disable_encrypted_credentials, namelist_s::name, and lsc_crypt_ctx_s::plaintext.
Referenced by lsc_crypt_get_password(), and lsc_crypt_get_private_key().
char* lsc_crypt_encrypt | ( | lsc_crypt_ctx_t | ctx, |
const char * | first_name, | ||
... | |||
) |
Encrypt a list of name/value pairs.
[in] | ctx | The context |
[in] | first_name | The name of the first name/value pair. This must be followed by a string value and optionaly followed by more name and value pairs. This list is terminated by a single NULL instead of a name. |
Definition at line 616 of file lsc_crypt.c.
References namelist_s::name, and namelist_s::value.
Referenced by migrate_156_to_157(), migrate_158_to_159(), migrate_160_to_161(), and migrate_165_to_166().
void lsc_crypt_flush | ( | lsc_crypt_ctx_t | ctx | ) |
Flush an LSC encryption context.
This function is used to flush the context. The flushing invalidates returned strings and internal caches. Basically this is the same as releasing and creating the context but it is optimized to keep some internal state.
[in] | ctx | The context or NULL |
Definition at line 586 of file lsc_crypt.c.
References lsc_crypt_ctx_s::namelist, namelist_s::next, lsc_crypt_ctx_s::plaintext, and namelist_s::value.
Referenced by lsc_crypt_release(), and next().
const char* lsc_crypt_get_password | ( | lsc_crypt_ctx_t | ctx, |
const char * | ciphertext | ||
) |
Return an encrypted password in the clear.
This function returns the encrypted password in the clear. The clear value may also be NULL , if no password is available. If a decryption has not yet been done, the passed ciphertext value is first decrypted. Thus a changed value of ciphertext may not have an effect. To force a decryption a call to lsc_crypt_flush is required.
[in] | ctx | The context |
[in] | ciphertext | The base64 encoded ciphertext. |
Definition at line 840 of file lsc_crypt.c.
References lsc_crypt_decrypt().
Referenced by migrate_160_to_161().
const char* lsc_crypt_get_private_key | ( | lsc_crypt_ctx_t | ctx, |
const char * | ciphertext | ||
) |
Return an encrypted private key in the clear.
This function returns the encrypted private key in the clear. The clear value may also be NULL , if no private key is available. If a decryption has not yet been done, the passed ciphertext value is first decrypted. Thus a changed value of ciphertext may not have an effect. To force a decryption a call to lsc_crypt_flush is required.
[in] | ctx | The context |
[in] | ciphertext | The base64 encoded ciphertext. |
Definition at line 864 of file lsc_crypt.c.
References lsc_crypt_decrypt().
Referenced by migrate_153_to_154().
lsc_crypt_ctx_t lsc_crypt_new | ( | ) |
Return a new context for LSC encryption.
Definition at line 507 of file lsc_crypt.c.
References lsc_crypt_ctx_s::encctx.
Referenced by lsc_crypt_create_key(), migrate_153_to_154(), migrate_156_to_157(), migrate_158_to_159(), migrate_160_to_161(), and migrate_165_to_166().
void lsc_crypt_release | ( | lsc_crypt_ctx_t | ctx | ) |
Release an LSC encryption context.
[in] | ctx | The context or NULL |
Definition at line 528 of file lsc_crypt.c.
References lsc_crypt_ctx_s::encctx, and lsc_crypt_flush().
Referenced by cleanup_iterator(), and migrate_160_to_161().
int disable_encrypted_credentials |
Flag indicating that encrypted credentials are disabled.
Setting this flag does not change any existing encrypted tuples but simply won't encrypt or decrypt anything. The variable is controlled by the command line option –disable-encrypted-credentials.
Definition at line 275 of file openvasmd.c.
Referenced by lsc_crypt_decrypt(), migrate_156_to_157(), migrate_158_to_159(), migrate_160_to_161(), and migrate_165_to_166().