/home/dko/Projects/mobilec/src/security/interface.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "xyssl-0.9/include/xyssl/havege.h"
#include "xyssl-0.9/include/xyssl/bignum.h"
#include "xyssl-0.9/include/xyssl/rsa.h"
#include "xyssl-0.9/include/xyssl/sha2.h"
#include "xyssl-0.9/include/xyssl/aes.h"

Go to the source code of this file.

Defines

#define PATH   xyssl-0.9/include/xyssl
#define MODE_ENCRYPT   0
#define MODE_DECRYPT   1
#define MAXDATASIZE   4096
#define KEY_SIZE   1024
#define EXPONENT   65537
#define RSA_EN   0
#define RSA_DE   1

Functions

int read_known_host_file (char *pubkey, char *hname, char *filename)
int read_encrypted_file (char *enfile, char *string, unsigned char *passphase)
int rsa_encryption (char *publickey, char *plaintext, char *ciphertext)
int rsa_decryption (char *ciphertext, char *plaintext, char *privatekeyfile)
int initiate_migration_process (int sockfd, int *nonce, char *publickey, char *privatekey, unsigned char *aes_key)
int reply_migration_process (int new_fd, int *nonce, char *publickey, char *privatekey, unsigned char *aes_key)
void generate_AES_key (char *key)
int generate_encrypt_send_AES_key (int sockfd, int *nonce, unsigned char *key, char *publickey, char *privkey)
int receive_decrypt_AES_key (int new_fd, int *nonce, unsigned char *key, char *privkey, char *publickey)
int aes_en_de (int mode, char *infile, char *outfile, unsigned char *AES_key, int *nonce, int sockfd)
int send_AES_en_MA (int sockfd, int *nonce, char *outfile, char *peer_pubkey)
int receive_AES_en_MA (int new_fd, int *nonce, char *infile, char *privatekey)
int receiving_verifying_MA_RSA (int sockfd, char *privkeyfile)
int receiving_decrypting_MA_RSA (int new_fd, char *privkeyfile)
int generate_RSA_keys_plaintext (char *pubkeyfile, char *privkeyfile)
int generate_RSA_keys_ciphertext (char *pubkeyfile, char *privkeyfile, unsigned char *passphrase)

Define Documentation

#define EXPONENT   65537

Definition at line 25 of file interface.h.

Referenced by generate_RSA_keys_ciphertext(), generate_RSA_keys_plaintext(), and main().

#define KEY_SIZE   1024

Definition at line 24 of file interface.h.

Referenced by generate_RSA_keys_ciphertext(), generate_RSA_keys_plaintext(), and main().

#define MAXDATASIZE   4096

Definition at line 22 of file interface.h.

#define MODE_DECRYPT   1

Definition at line 21 of file interface.h.

Referenced by aes_en_de(), and main().

#define MODE_ENCRYPT   0

Definition at line 20 of file interface.h.

Referenced by aes_en_de(), and main().

#define PATH   xyssl-0.9/include/xyssl

Definition at line 9 of file interface.h.

#define RSA_DE   1

Definition at line 28 of file interface.h.

Referenced by rsa_decryption().

#define RSA_EN   0

Definition at line 27 of file interface.h.

Referenced by rsa_encryption().


Function Documentation

int aes_en_de ( int  mode,
char *  infile,
char *  outfile,
unsigned char *  AES_key,
int nonce,
int  sockfd 
)
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_encrypt_send_AES_key ( int  sockfd,
int nonce,
unsigned char *  key,
char *  publickey,
char *  privkey 
)
int generate_RSA_keys_ciphertext ( char *  pubkeyfile,
char *  privkeyfile,
unsigned char *  passphrase 
)
int generate_RSA_keys_plaintext ( char *  pubkeyfile,
char *  privkeyfile 
)
int initiate_migration_process ( int  sockfd,
int nonce,
char *  publickey,
char *  privatekey,
unsigned char *  aes_key 
)
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().

int receive_AES_en_MA ( int  new_fd,
int nonce,
char *  infile,
char *  privatekey 
)

Definition at line 1555 of file interface.c.

References rsa_decryption(), and size.

Referenced by rece_de_msg().

int receive_decrypt_AES_key ( int  new_fd,
int nonce,
unsigned char *  key,
char *  privkey,
char *  publickey 
)
int receiving_decrypting_MA_RSA ( int  new_fd,
char *  privkeyfile 
)
int receiving_verifying_MA_RSA ( int  sockfd,
char *  privkeyfile 
)
int reply_migration_process ( int  new_fd,
int nonce,
char *  publickey,
char *  privatekey,
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 *  privatekeyfile 
)
int rsa_encryption ( char *  publickey,
char *  plaintext,
char *  ciphertext 
)
int send_AES_en_MA ( int  sockfd,
int nonce,
char *  outfile,
char *  peer_pubkey 
)

Definition at line 1419 of file interface.c.

References int, rsa_encryption(), send, and size.

Referenced by auth_rece_send_msg().

Generated on Tue Dec 28 15:15:28 2010 for Mobile-C by  doxygen 1.6.3