view src/lib-dcrypt/ostream-encrypt.h @ 22310:a28f5bfb15fc

fts: Do not attempt to deinitialize backend if it's not set If FTS backend initialization fails or does not happen, flist->backend might end up being NULL, and attempt to deinitialize NULL won't end well.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Wed, 17 May 2017 12:26:42 +0300
parents 9a2ac2a69648
children
line wrap: on
line source

#ifndef OSTREAM_ENCRYPT_H
#define OSTREAM_ENCRYPT_H

struct dcrypt_public_key;
struct dcrypt_context_symmetric;

/**
 * algorithm is in form AES-256-CBC-SHA1, recommended
 * AES-256-GCM-SHA256
 *
 * Algorithms (both crypto and digest) *MUST* have OID to use it.
 *
 */

struct ostream *
o_stream_create_encrypt(struct ostream *output,
	const char *algorithm,
	struct dcrypt_public_key *box_pub,
	enum io_stream_encrypt_flags flags);

/* create context for performing encryption with
   preset crypto context. do not call ctx_sym_init.

   no header or mac is written, just plain crypto
   data.
 */
struct ostream *
o_stream_create_sym_encrypt(struct ostream *output,
	struct dcrypt_context_symmetric *ctx);

#endif