knet_handle_crypto3
Set up packet cryptographic signing & encryption
Usage
#include <libknet.h>
int knet_handle_crypto(
knet_handle_t knet_h,
struct knet_handle_crypto_cfg *knet_handle_crypto_cfg
);
Overview
knet_handle_crypto
knet_h - pointer to knet_handle_t
knet_handle_crypto_cfg - pointer to a knet_handle_crypto_cfg structure see knet_handle_crypto_set_config(3) for details.
Implementation notes:
knet_handle_crypto(3) is now a wrapper for knet_handle_crypto_set_config(3) and knet_handle_crypto_use_config(3) with config_num set to 1.
Structures
Structure passed into knet_handle_set_crypto_config() to determine the crypto options to use for the current communications handle
struct knet_handle_crypto_cfg {
char crypto_model[16]; /* Model to use. nss, openssl, etc */
char crypto_cipher_type[16]; /* Cipher type name for encryption. aes 256 etc */
char crypto_hash_type[16]; /* Hash type for digest. sha512 etc */
unsigned char private_key[KNET_MAX_KEY_LEN]; /* Private key */
unsigned int private_key_len; /* Length of private key */
};
Return value
knet_handle_crypto returns:
0 on success
-1 on error and errno is set.
-2 on crypto subsystem initialization error. No errno is provided at the moment (yet).
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.