]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: add dcrypt-iostream.h
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Sat, 6 Aug 2016 19:07:00 +0000 (22:07 +0300)
committerGitLab <gitlab@git.dovecot.net>
Mon, 8 Aug 2016 08:08:56 +0000 (11:08 +0300)
Move everything from dcrypt-iostream-private.h and enum
io_stream_encrypt_flags to the new dcrypt-iostream.h file.

src/lib-dcrypt/Makefile.am
src/lib-dcrypt/dcrypt-iostream-private.h [deleted file]
src/lib-dcrypt/dcrypt-iostream.h [new file with mode: 0644]
src/lib-dcrypt/istream-decrypt.c
src/lib-dcrypt/ostream-encrypt.c
src/lib-dcrypt/ostream-encrypt.h
src/lib-dcrypt/test-crypto.c
src/lib-dcrypt/test-stream.c

index 946590e7b74ed8ecd1a1843163e3e39f89e556f8..62c46256de73b1bc0b1345b2fee5d164f4057f5b 100644 (file)
@@ -26,7 +26,7 @@ endif
 
 headers = \
        dcrypt.h \
-       dcrypt-iostream-private.h \
+       dcrypt-iostream.h \
        dcrypt-private.h \
        ostream-encrypt.h \
        istream-decrypt.h
diff --git a/src/lib-dcrypt/dcrypt-iostream-private.h b/src/lib-dcrypt/dcrypt-iostream-private.h
deleted file mode 100644 (file)
index d5cb7f1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef DCRYPT_IOSTREAM_PRIVATE_H
-#define DCRYPT_IOSTREAM_PRIVATE 1
-
-static const unsigned char IOSTREAM_CRYPT_MAGIC[] = {'C','R','Y','P','T','E','D','\x03','\x07'};
-#define IOSTREAM_CRYPT_VERSION 2
-#define IOSTREAM_TAG_SIZE 16
-
-#endif
diff --git a/src/lib-dcrypt/dcrypt-iostream.h b/src/lib-dcrypt/dcrypt-iostream.h
new file mode 100644 (file)
index 0000000..a237eaa
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef DCRYPT_IOSTREAM_H
+#define DCRYPT_IOSTREAM_H 1
+
+static const unsigned char IOSTREAM_CRYPT_MAGIC[] = {'C','R','Y','P','T','E','D','\x03','\x07'};
+#define IOSTREAM_CRYPT_VERSION 2
+#define IOSTREAM_TAG_SIZE 16
+
+enum io_stream_encrypt_flags {
+       IO_STREAM_ENC_INTEGRITY_HMAC = 0x1,
+       IO_STREAM_ENC_INTEGRITY_AEAD = 0x2,
+       IO_STREAM_ENC_INTEGRITY_NONE = 0x4,
+       IO_STREAM_ENC_VERSION_1      = 0x8,
+};
+
+#endif
index b4c77b31e799831b101f003eec12cffa31a6dfd3..0924fa54087d8add0bfe41e644e5b7f468edd589 100644 (file)
@@ -8,7 +8,7 @@
 #include "istream.h"
 #include "istream-decrypt.h"
 #include "istream-private.h"
-#include "dcrypt-iostream-private.h"
+#include "dcrypt-iostream.h"
 
 #include "hex-binary.h"
 
 
 #define ISTREAM_DECRYPT_READ_FIRST 15
 
-enum io_stream_encrypt_flags {
-       IO_STREAM_ENC_INTEGRITY_HMAC = 0x1,
-       IO_STREAM_ENC_INTEGRITY_AEAD = 0x2,
-       IO_STREAM_ENC_INTEGRITY_NONE = 0x4,
-       IO_STREAM_ENC_VERSION_1      = 0x8,
-};
-
 struct decrypt_istream {
        struct istream_private istream;
        buffer_t *buf;
index 37a937673d58685aa91d77b4c005f261d3278ce3..84919d32d82a74be8ddb97beb81f1d8155fb05e2 100644 (file)
 #include "lib.h"
 #include "buffer.h"
 #include "randgen.h"
+#include "dcrypt-iostream.h"
 #include "ostream-encrypt.h"
 #include "ostream-private.h"
 #include "hash-method.h"
 #include "sha2.h"
 #include "safe-memset.h"
 #include "dcrypt.h"
-#include "dcrypt-iostream-private.h"
 
 #include <arpa/inet.h>
 
index b6f628c2b3eb5fa5df5dc490718db9af0f8b19b0..e2023b5e63e4321414fa234fac85323fcf418849 100644 (file)
@@ -12,13 +12,6 @@ struct dcrypt_context_symmetric;
  *
  */
 
-enum io_stream_encrypt_flags {
-       IO_STREAM_ENC_INTEGRITY_HMAC = 0x1,
-       IO_STREAM_ENC_INTEGRITY_AEAD = 0x2,
-       IO_STREAM_ENC_INTEGRITY_NONE = 0x4,
-       IO_STREAM_ENC_VERSION_1      = 0x8,
-};
-
 struct ostream *
 o_stream_create_encrypt(struct ostream *output,
        const char *algorithm,
index 6f79a1977bfc88a2216e955cf33a8fb91412f806..19a9a78955d65980d272b0145bc4ddbaad52503c 100644 (file)
@@ -2,10 +2,10 @@
 #include "buffer.h"
 #include "str.h"
 #include "dcrypt.h"
+#include "dcrypt-iostream.h"
 #include "ostream.h"
 #include "ostream-encrypt.h"
 #include "istream.h"
-#include "istream-decrypt.h"
 #include "iostream-temp.h"
 #include "randgen.h"
 #include "test-common.h"
index dc1d24cb4fe4ba5b8e233e42b3871292a13db33f..06c5d3775975f0a439d637749257cd90f8a34b27 100644 (file)
@@ -2,6 +2,7 @@
 #include "buffer.h"
 #include "str.h"
 #include "dcrypt.h"
+#include "dcrypt-iostream.h"
 #include "ostream.h"
 #include "ostream-encrypt.h"
 #include "istream.h"