7 #ifndef WITHOUT_OPENSSL
8 #include <openssl/ssl.h>
9 #include <openssl/md5.h>
10 #include <openssl/sha.h>
13 #define NIXIO_TLS_CTX_META "nixio.tls.ctx"
14 #define NIXIO_TLS_SOCK_META "nixio.tls.sock"
16 typedef struct nixio_tls_socket {
26 #define NIXIO_CRYPTO_HASH_META "nixio.crypto.hash"
27 #define NIXIO_DIGEST_SIZE 64
28 #define NIXIO_CRYPTO_BLOCK_SIZE 64
30 #define NIXIO_HASH_NONE 0
31 #define NIXIO_HASH_MD5 0x01
32 #define NIXIO_HASH_SHA1 0x02
34 #define NIXIO_HMAC_BIT 0x40
36 typedef int(*nixio_hash_initcb)(void *);
37 typedef int(*nixio_hash_updatecb)(void *, const void *, unsigned long);
38 typedef int(*nixio_hash_finalcb)(unsigned char *, void *);
40 typedef struct nixio_hash_obj {
42 unsigned char digest[NIXIO_DIGEST_SIZE];
44 unsigned char key[NIXIO_CRYPTO_BLOCK_SIZE];
48 nixio_hash_initcb init;
49 nixio_hash_updatecb update;
50 nixio_hash_finalcb final;
53 #endif /* NIXIO_TLS_H_ */