aboutsummaryrefslogtreecommitdiff
path: root/src/challenge.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2017-12-18 23:31:09 +0100
committerToni Uhlig <matzeton@googlemail.com>2017-12-18 23:31:09 +0100
commit3c491a8bec71606b7af5f1d8c34de8e9710bbe13 (patch)
tree8d909a5a1fc72138887078c9c54b3b6514253234 /src/challenge.h
parent9c82c27e6326609150db837f37077774a8a5919c (diff)
ptunnel-ng:
* this is now an autotools project (added/renamed required files e.g. AUTHORS, COPYING) * removed user defined ip header (buggy; not useful anymore)
Diffstat (limited to 'src/challenge.h')
-rw-r--r--src/challenge.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/challenge.h b/src/challenge.h
new file mode 100644
index 0000000..4863782
--- /dev/null
+++ b/src/challenge.h
@@ -0,0 +1,23 @@
+#ifndef CHALLENGE_H
+#define CHALLENGE_H 1
+
+#include <stdint.h>
+
+/** challenge_t: This structure contains the pseudo-random challenge used for
+ * authentication.
+ */
+typedef struct challenge_t {
+ /** tv_sec as returned by gettimeofday */
+ uint32_t sec;
+ /** tv_usec as returned by gettimeofday + random value */
+ uint32_t usec_rnd;
+ /** random values */
+ uint32_t random[6];
+} __attribute__ ((packed)) challenge_t;
+
+
+challenge_t* generate_challenge(void);
+void generate_response(challenge_t *challenge);
+int validate_challenge(challenge_t *local, challenge_t *remote);
+
+#endif