summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/nixio-tls.h
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-04-21 16:26:45 +0000
committerSteven Barth <steven@midlink.org>2009-04-21 16:26:45 +0000
commita2b916ab736802050b19562b7c163e3f3bb1566f (patch)
treed35b68f7bcac43f66f4cdb915ef327b76856594b /libs/nixio/src/nixio-tls.h
parent085a0a9ec040fc3ea5ee537d2cee724aa775747b (diff)
Merge nixio 0.2
Diffstat (limited to 'libs/nixio/src/nixio-tls.h')
-rw-r--r--libs/nixio/src/nixio-tls.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libs/nixio/src/nixio-tls.h b/libs/nixio/src/nixio-tls.h
index 4c58dd136..0fac5a980 100644
--- a/libs/nixio/src/nixio-tls.h
+++ b/libs/nixio/src/nixio-tls.h
@@ -2,9 +2,12 @@
#define NIXIO_TLS_H_
#include "nixio.h"
+#include <sys/types.h>
#ifndef WITHOUT_OPENSSL
#include <openssl/ssl.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
#endif
#define NIXIO_TLS_CTX_META "nixio.tls.ctx"
@@ -20,4 +23,31 @@ typedef struct nixio_tls_socket {
#endif
} nixio_tls_sock;
+#define NIXIO_CRYPTO_HASH_META "nixio.crypto.hash"
+#define NIXIO_DIGEST_SIZE 64
+#define NIXIO_CRYPTO_BLOCK_SIZE 64
+
+#define NIXIO_HASH_NONE 0
+#define NIXIO_HASH_MD5 0x01
+#define NIXIO_HASH_SHA1 0x02
+
+#define NIXIO_HMAC_BIT 0x40
+
+typedef int(*nixio_hash_initcb)(void *);
+typedef int(*nixio_hash_updatecb)(void *, const void *, unsigned long);
+typedef int(*nixio_hash_finalcb)(unsigned char *, void *);
+
+typedef struct nixio_hash_obj {
+ uint type;
+ unsigned char digest[NIXIO_DIGEST_SIZE];
+ size_t digest_size;
+ unsigned char key[NIXIO_CRYPTO_BLOCK_SIZE];
+ size_t key_size;
+ size_t block_size;
+ void *ctx;
+ nixio_hash_initcb init;
+ nixio_hash_updatecb update;
+ nixio_hash_finalcb final;
+} nixio_hash;
+
#endif /* NIXIO_TLS_H_ */