22 #include <openssl/bio.h>
23 #include <openssl/evp.h>
24 #include <openssl/crypto.h>
25 #include <openssl/x509.h>
26 #include <openssl/err.h>
27 #include <openssl/rand.h>
28 #include <openssl/rsa.h>
29 #include <openssl/pem.h>
31 #include <sys/types.h>
33 #define RSA_PUB_EXPONENT 65537
38 RSA *
genrsa(
int key_bits, u_char **pub, u_int *pub_len, u_char **priv, u_int *priv_len);
39 RSA *
get_rsa_pub(
const u_char **pub_key,
long length);
41 u_char *
hash_sha1(u_char *msg, u_int len, u_char *hash);
42 u_char *
hash_md5(u_char *msg, u_int m_len, u_char *hash);
43 u_char *
rsa_sign(u_char *msg, u_int m_len, RSA *priv, u_int *siglen);
44 int verify_sign(u_char *msg, u_int m_len, u_char *signature, u_int siglen, RSA *pub);
u_char * rsa_sign(u_char *msg, u_int m_len, RSA *priv, u_int *siglen)
Definition: crypto.c:138
char * ssl_strerr(void)
Definition: crypto.c:49
u_char * hash_md5(u_char *msg, u_int m_len, u_char *hash)
Definition: crypto.c:128
void init_crypto(void)
Definition: crypto.c:38
int verify_sign(u_char *msg, u_int m_len, u_char *signature, u_int siglen, RSA *pub)
Definition: crypto.c:160
RSA * genrsa(int key_bits, u_char **pub, u_int *pub_len, u_char **priv, u_int *priv_len)
Definition: crypto.c:61
RSA * get_rsa_priv(const u_char **priv_key, long length)
Definition: crypto.c:118
RSA * get_rsa_pub(const u_char **pub_key, long length)
Definition: crypto.c:107
void free_crypto(void)
Definition: crypto.c:44
u_char * hash_sha1(u_char *msg, u_int len, u_char *hash)
Definition: crypto.c:123