#include "interface.h"
#include <sys/socket.h>
Go to the source code of this file.
Functions | |
static void | separate_key_parts (char *key, char *N, char *E, char *D, char *P, char *Q, char *DP, char *DQ, char *QP) |
int | rsa_encryption (char *publickey, char *plaintext, char *ciphertext) |
int | rsa_decryption (char *ciphertext, char *plaintext, char *privatekey) |
static int | append_nonce_to_MA (int *my_nonce, char *MA_file) |
static int | remove_nonce_from_MA (char *MA_file) |
static int | extract_nonce_from_MA (int sockfd, int *my_nonce, char *MA_file) |
int | read_known_host_file (char *pubkey, char *hname, char *filename) |
int | read_encrypted_file (char *enfile, char *string, unsigned char *passphase) |
int | initiate_migration_process (int new_fd, int *my_nonce, char *pubkey, char *privkey, unsigned char *aes_key) |
int | reply_migration_process (int sockfd, int *my_nonce, char *pubkey, char *privkey, unsigned char *aes_key) |
void | generate_AES_key (char *key) |
int | aes_en_de (int mode, char *infile, char *outfile, unsigned char *AES_key, int *nonce, int new_fd) |
int | send_AES_en_MA (int sockfd, int *my_nonce, char *outfile, char *pubkey) |
int | receive_AES_en_MA (int new_fd, int *nonce, char *infile, char *privkey) |
int | generate_RSA_keys_plaintext (char *pubkeyfile, char *privkeyfile) |
int | generate_RSA_keys_ciphertext (char *pubkeyfile, char *privkeyfile, unsigned char *passphrase) |
int aes_en_de | ( | int | mode, | |
char * | infile, | |||
char * | outfile, | |||
unsigned char * | AES_key, | |||
int * | nonce, | |||
int | new_fd | |||
) |
Definition at line 1122 of file interface.c.
References aes_crypt_ecb(), AES_DECRYPT, AES_ENCRYPT, aes_setkey_dec(), aes_setkey_enc(), append_nonce_to_MA(), extract_nonce_from_MA(), int, MODE_DECRYPT, MODE_ENCRYPT, sha2_finish(), sha2_hmac_finish(), sha2_hmac_starts(), sha2_hmac_update(), sha2_starts(), and sha2_update().
Referenced by auth_rece_send_msg(), generate_RSA_keys_ciphertext(), read_encrypted_file(), and rece_de_msg().
Definition at line 187 of file interface.c.
Referenced by aes_en_de().
Definition at line 264 of file interface.c.
References remove_nonce_from_MA(), and send.
Referenced by aes_en_de().
void generate_AES_key | ( | char * | key | ) |
Definition at line 1099 of file interface.c.
References havege_init(), and havege_rand().
Referenced by initiate_migration_process(), and reply_migration_process().
int generate_RSA_keys_ciphertext | ( | char * | pubkeyfile, | |
char * | privkeyfile, | |||
unsigned char * | passphrase | |||
) |
Definition at line 1752 of file interface.c.
References aes_en_de(), rsa_context::D, rsa_context::DP, rsa_context::DQ, rsa_context::E, EXPONENT, havege_init(), havege_rand(), KEY_SIZE, mpi_write_file(), rsa_context::N, rsa_context::P, rsa_context::Q, rsa_context::QP, rsa_gen_key(), rsa_init(), and RSA_PKCS_V15.
Referenced by main().
int generate_RSA_keys_plaintext | ( | char * | pubkeyfile, | |
char * | privkeyfile | |||
) |
Definition at line 1693 of file interface.c.
References rsa_context::D, rsa_context::DP, rsa_context::DQ, rsa_context::E, EXPONENT, havege_init(), havege_rand(), KEY_SIZE, mpi_write_file(), rsa_context::N, rsa_context::P, rsa_context::Q, rsa_context::QP, rsa_gen_key(), rsa_init(), and RSA_PKCS_V15.
Referenced by main().
int initiate_migration_process | ( | int | new_fd, | |
int * | my_nonce, | |||
char * | pubkey, | |||
char * | privkey, | |||
unsigned char * | aes_key | |||
) |
Definition at line 432 of file interface.c.
References generate_AES_key(), havege_init(), havege_rand(), md5(), rsa_decryption(), rsa_encryption(), and send.
Referenced by auth_rece_send_msg().
int read_encrypted_file | ( | char * | enfile, | |
char * | string, | |||
unsigned char * | passphase | |||
) |
Definition at line 398 of file interface.c.
References aes_en_de(), and f.
Referenced by MC_Initialize().
int read_known_host_file | ( | char * | pubkey, | |
char * | hname, | |||
char * | filename | |||
) |
Definition at line 329 of file interface.c.
Referenced by auth_conn_rece_key(), and auth_rece_send_msg().
Definition at line 1555 of file interface.c.
References rsa_decryption(), and size.
Referenced by rece_de_msg().
static int remove_nonce_from_MA | ( | char * | MA_file | ) | [static] |
int reply_migration_process | ( | int | sockfd, | |
int * | my_nonce, | |||
char * | pubkey, | |||
char * | privkey, | |||
unsigned char * | aes_key | |||
) |
Definition at line 777 of file interface.c.
References generate_AES_key(), md5(), rsa_decryption(), rsa_encryption(), and send.
Referenced by auth_conn_rece_key().
int rsa_decryption | ( | char * | ciphertext, | |
char * | plaintext, | |||
char * | privatekey | |||
) |
Definition at line 133 of file interface.c.
References rsa_context::D, rsa_context::DP, rsa_context::DQ, rsa_context::E, rsa_context::len, mpi_msb(), mpi_read_mystring(), rsa_context::N, rsa_context::P, P, rsa_context::Q, rsa_context::QP, rsa_check_privkey(), RSA_DE, rsa_init(), rsa_pkcs1_decrypt(), RSA_PKCS_V15, and separate_key_parts().
Referenced by initiate_migration_process(), receive_AES_en_MA(), and reply_migration_process().
int rsa_encryption | ( | char * | publickey, | |
char * | plaintext, | |||
char * | ciphertext | |||
) |
Definition at line 91 of file interface.c.
References rsa_context::E, rsa_context::len, mpi_msb(), mpi_read_mystring(), rsa_context::N, rsa_check_pubkey(), RSA_EN, rsa_init(), rsa_pkcs1_encrypt(), RSA_PKCS_V15, and separate_key_parts().
Referenced by initiate_migration_process(), reply_migration_process(), and send_AES_en_MA().
Definition at line 1419 of file interface.c.
References int, rsa_encryption(), send, and size.
Referenced by auth_rece_send_msg().
static void separate_key_parts | ( | char * | key, | |
char * | N, | |||
char * | E, | |||
char * | D, | |||
char * | P, | |||
char * | Q, | |||
char * | DP, | |||
char * | DQ, | |||
char * | QP | |||
) | [static] |
Definition at line 28 of file interface.c.
Referenced by rsa_decryption(), and rsa_encryption().