/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dcrypt.h"
#include "dcrypt-iostream.h"
#include "ostream-encrypt.h"
#include "istream-private.h"
#include "istream-decrypt.h"
#include "doveadm-dump.h"
#include "hex-binary.h"
#include "str.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
{
return;
}
if (key_type == DCRYPT_KEY_RSA)
printf("key type: DCRYPT_KEY_RSA\n");
else if (key_type == DCRYPT_KEY_EC)
printf("key type: DCRYPT_KEY_EC\n");
} else {
if (key_type == DCRYPT_KEY_EC) {
buffer_set_used_size(hash, 0);
i_error("dcrypt_key_id_public_old failed: %s",
error);
} else {
}
}
}
}
{
&error);
return;
}
if (key_type == DCRYPT_KEY_RSA)
printf("key type: DCRYPT_KEY_RSA\n");
else if (key_type == DCRYPT_KEY_EC)
printf("key type: DCRYPT_KEY_EC\n");
} else {
if (key_type == DCRYPT_KEY_EC) {
buffer_set_used_size(hash, 0);
} else {
}
}
}
}
{
if (fd < 0) {
return FALSE;
}
if (res < 0) {
i_close_fd(&fd);
return FALSE;
}
i_close_fd(&fd);
const char *encryption_key_hash;
const char *key_hash;
const char *error;
return FALSE;
}
switch (format) {
case DCRYPT_FORMAT_PEM:
printf("format: DCRYPT_FORMAT_PEM\n");
break;
case DCRYPT_FORMAT_DOVECOT:
printf("format: DCRYPT_FORMAT_DOVECOT\n");
break;
}
switch (version) {
case DCRYPT_KEY_VERSION_1:
printf("version: DCRYPT_KEY_VERSION_1\n");
break;
case DCRYPT_KEY_VERSION_2:
printf("version: DCRYPT_KEY_VERSION_2\n");
break;
case DCRYPT_KEY_VERSION_NA:
printf("version: DCRYPT_KEY_VERSION_NA\n");
break;
}
switch (kind) {
case DCRYPT_KEY_KIND_PUBLIC:
printf("kind: DCRYPT_KEY_KIND_PUBLIC\n");
break;
case DCRYPT_KEY_KIND_PRIVATE:
printf("kind: DCRYPT_KEY_KIND_PRIVATE\n");
break;
}
switch (encryption_type) {
printf("encryption_type: DCRYPT_KEY_ENCRYPTION_TYPE_NONE\n");
break;
printf("encryption_type: DCRYPT_KEY_ENCRYPTION_TYPE_KEY\n");
break;
printf("encryption_type: DCRYPT_KEY_ENCRYPTION_TYPE_PASSWORD\n");
break;
}
if (encryption_key_hash != NULL)
switch (kind) {
case DCRYPT_KEY_KIND_PUBLIC:
break;
case DCRYPT_KEY_KIND_PRIVATE:
break;
}
return TRUE;
}
{
return FALSE;
return ret;
}
{
}
"dcrypt-key",
};