lib/crypt.cpp File Reference

(r16139/r16069)

#include "config.h"
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <openssl/ssl.h>
#include <openssl/md5.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/conf.h>
#include <openssl/engine.h>
#include <openssl/err.h>
#include "md5_file.h"
#include "cert_sig.h"
#include "filesys.h"
#include "error_numbers.h"
#include "crypt.h"

Include dependency graph for crypt.cpp:


Functions

int print_hex_data (FILE *f, DATA_BLOCK &x)
int sprint_hex_data (char *out_buf, DATA_BLOCK &x)
int print_raw_data (FILE *f, DATA_BLOCK &x)
int scan_raw_data (FILE *f, DATA_BLOCK &x)
int scan_hex_data (FILE *f, DATA_BLOCK &x)
int print_key_hex (FILE *f, KEY *key, int size)
int scan_key_hex (FILE *f, KEY *key, int size)
int sscan_key_hex (const char *buf, KEY *key, int size)
int encrypt_private (R_RSA_PRIVATE_KEY &key, DATA_BLOCK &in, DATA_BLOCK &out)
int decrypt_public (R_RSA_PUBLIC_KEY &key, DATA_BLOCK &in, DATA_BLOCK &out)
int sign_file (const char *path, R_RSA_PRIVATE_KEY &key, DATA_BLOCK &signature)
int sign_block (DATA_BLOCK &data_block, R_RSA_PRIVATE_KEY &key, DATA_BLOCK &signature)
int generate_signature (char *text_to_sign, char *signature_hex, R_RSA_PRIVATE_KEY &key)
int verify_file (const char *path, R_RSA_PUBLIC_KEY &key, DATA_BLOCK &signature, bool &answer)
int verify_file2 (const char *path, const char *signature_text, const char *key_text, bool &answer)
int verify_string (const char *text, const char *signature_text, R_RSA_PUBLIC_KEY &key, bool &answer)
int verify_string2 (const char *text, const char *signature_text, const char *key_text, bool &answer)
int read_key_file (const char *keyfile, R_RSA_PRIVATE_KEY &key)
void openssl_to_keys (RSA *rp, int nbits, R_RSA_PRIVATE_KEY &priv, R_RSA_PUBLIC_KEY &pub)
void private_to_openssl (R_RSA_PRIVATE_KEY &priv, RSA *rp)
void public_to_openssl (R_RSA_PUBLIC_KEY &pub, RSA *rp)
int openssl_to_private (RSA *from, R_RSA_PRIVATE_KEY *to)
int check_validity_of_cert (const char *cFile, const unsigned char *md5_md, unsigned char *sfileMsg, const int sfsize, const char *caPath)
char * check_validity (const char *certPath, const char *origFile, unsigned char *signature, char *caPath)
int cert_verify_file (CERT_SIGS *signatures, const char *origFile, const char *trustLocation)

Variables

const char * BOINC_RCSID_4f0c2e42ea = "$Id: crypt.cpp 16069 2008-09-26 18:20:24Z davea $"

Function Documentation

int cert_verify_file ( CERT_SIGS signatures,
const char *  origFile,
const char *  trustLocation 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char* check_validity ( const char *  certPath,
const char *  origFile,
unsigned char *  signature,
char *  caPath 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int check_validity_of_cert ( const char *  cFile,
const unsigned char *  md5_md,
unsigned char *  sfileMsg,
const int  sfsize,
const char *  caPath 
)

Here is the caller graph for this function:

int decrypt_public ( R_RSA_PUBLIC_KEY key,
DATA_BLOCK in,
DATA_BLOCK out 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int encrypt_private ( R_RSA_PRIVATE_KEY key,
DATA_BLOCK in,
DATA_BLOCK out 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int generate_signature ( char *  text_to_sign,
char *  signature_hex,
R_RSA_PRIVATE_KEY key 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void openssl_to_keys ( RSA *  rp,
int  nbits,
R_RSA_PRIVATE_KEY priv,
R_RSA_PUBLIC_KEY pub 
)

Here is the caller graph for this function:

int openssl_to_private ( RSA *  from,
R_RSA_PRIVATE_KEY to 
)

Here is the caller graph for this function:

int print_hex_data ( FILE *  f,
DATA_BLOCK x 
)

Here is the caller graph for this function:

int print_key_hex ( FILE *  f,
KEY key,
int  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int print_raw_data ( FILE *  f,
DATA_BLOCK x 
)

Here is the caller graph for this function:

void private_to_openssl ( R_RSA_PRIVATE_KEY priv,
RSA *  rp 
)

Here is the caller graph for this function:

void public_to_openssl ( R_RSA_PUBLIC_KEY pub,
RSA *  rp 
)

Here is the caller graph for this function:

int read_key_file ( const char *  keyfile,
R_RSA_PRIVATE_KEY key 
)

Here is the call graph for this function:

int scan_hex_data ( FILE *  f,
DATA_BLOCK x 
)

Here is the caller graph for this function:

int scan_key_hex ( FILE *  f,
KEY key,
int  size 
)

Here is the caller graph for this function:

int scan_raw_data ( FILE *  f,
DATA_BLOCK x 
)

Here is the caller graph for this function:

int sign_block ( DATA_BLOCK data_block,
R_RSA_PRIVATE_KEY key,
DATA_BLOCK signature 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int sign_file ( const char *  path,
R_RSA_PRIVATE_KEY key,
DATA_BLOCK signature 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int sprint_hex_data ( char *  out_buf,
DATA_BLOCK x 
)

Here is the caller graph for this function:

int sscan_key_hex ( const char *  buf,
KEY key,
int  size 
)

Here is the caller graph for this function:

int verify_file ( const char *  path,
R_RSA_PUBLIC_KEY key,
DATA_BLOCK signature,
bool &  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int verify_file2 ( const char *  path,
const char *  signature_text,
const char *  key_text,
bool &  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int verify_string ( const char *  text,
const char *  signature_text,
R_RSA_PUBLIC_KEY key,
bool &  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int verify_string2 ( const char *  text,
const char *  signature_text,
const char *  key_text,
bool &  answer 
)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* BOINC_RCSID_4f0c2e42ea = "$Id: crypt.cpp 16069 2008-09-26 18:20:24Z davea $"


Generated on Mon Oct 6 10:40:09 2008 for BOINC by  doxygen 1.5.6