#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"

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 $" |
| int cert_verify_file | ( | CERT_SIGS * | signatures, | |
| const char * | origFile, | |||
| const char * | trustLocation | |||
| ) |


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


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

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


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


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


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

| int openssl_to_private | ( | RSA * | from, | |
| R_RSA_PRIVATE_KEY * | to | |||
| ) |

| int print_hex_data | ( | FILE * | f, | |
| DATA_BLOCK & | x | |||
| ) |

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


| int print_raw_data | ( | FILE * | f, | |
| DATA_BLOCK & | x | |||
| ) |

| void private_to_openssl | ( | R_RSA_PRIVATE_KEY & | priv, | |
| RSA * | rp | |||
| ) |

| void public_to_openssl | ( | R_RSA_PUBLIC_KEY & | pub, | |
| RSA * | rp | |||
| ) |

| int read_key_file | ( | const char * | keyfile, | |
| R_RSA_PRIVATE_KEY & | key | |||
| ) |

| int scan_hex_data | ( | FILE * | f, | |
| DATA_BLOCK & | x | |||
| ) |

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

| int scan_raw_data | ( | FILE * | f, | |
| DATA_BLOCK & | x | |||
| ) |

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


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


| int sprint_hex_data | ( | char * | out_buf, | |
| DATA_BLOCK & | x | |||
| ) |

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

| 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 | |||
| ) |


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