From: Martti Rannanjärvi Date: Sat, 6 Aug 2016 19:07:00 +0000 (+0300) Subject: lib-dcrypt: add dcrypt-iostream.h X-Git-Tag: 2.3.0.rc1~3229 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17fbd200b78112bd0d89e89598aa01cea72a74e5;p=thirdparty%2Fdovecot%2Fcore.git lib-dcrypt: add dcrypt-iostream.h Move everything from dcrypt-iostream-private.h and enum io_stream_encrypt_flags to the new dcrypt-iostream.h file. --- diff --git a/src/lib-dcrypt/Makefile.am b/src/lib-dcrypt/Makefile.am index 946590e7b7..62c46256de 100644 --- a/src/lib-dcrypt/Makefile.am +++ b/src/lib-dcrypt/Makefile.am @@ -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 index d5cb7f17bc..0000000000 --- a/src/lib-dcrypt/dcrypt-iostream-private.h +++ /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 index 0000000000..a237eaa56a --- /dev/null +++ b/src/lib-dcrypt/dcrypt-iostream.h @@ -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 diff --git a/src/lib-dcrypt/istream-decrypt.c b/src/lib-dcrypt/istream-decrypt.c index b4c77b31e7..0924fa5408 100644 --- a/src/lib-dcrypt/istream-decrypt.c +++ b/src/lib-dcrypt/istream-decrypt.c @@ -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" @@ -16,13 +16,6 @@ #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; diff --git a/src/lib-dcrypt/ostream-encrypt.c b/src/lib-dcrypt/ostream-encrypt.c index 37a937673d..84919d32d8 100644 --- a/src/lib-dcrypt/ostream-encrypt.c +++ b/src/lib-dcrypt/ostream-encrypt.c @@ -16,13 +16,13 @@ #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 diff --git a/src/lib-dcrypt/ostream-encrypt.h b/src/lib-dcrypt/ostream-encrypt.h index b6f628c2b3..e2023b5e63 100644 --- a/src/lib-dcrypt/ostream-encrypt.h +++ b/src/lib-dcrypt/ostream-encrypt.h @@ -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, diff --git a/src/lib-dcrypt/test-crypto.c b/src/lib-dcrypt/test-crypto.c index 6f79a1977b..19a9a78955 100644 --- a/src/lib-dcrypt/test-crypto.c +++ b/src/lib-dcrypt/test-crypto.c @@ -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" diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index dc1d24cb4f..06c5d37759 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -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"