summaryrefslogtreecommitdiff
path: root/lib/opencdk/hash.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-07-02 15:24:05 +0200
committerSimon Josefsson <simon@josefsson.org>2008-07-02 15:24:05 +0200
commitbade988016aa5d2936c6bdf53570125181cfe2f9 (patch)
tree65948be9cd75ccfb8fd2a6c26ad15caed4119cc5 /lib/opencdk/hash.c
parent36f07088e2979bf28e52fec4992d3da04e73eb6c (diff)
downloadgnutls-bade988016aa5d2936c6bdf53570125181cfe2f9.tar.gz
Indent code.
Diffstat (limited to 'lib/opencdk/hash.c')
-rw-r--r--lib/opencdk/hash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/opencdk/hash.c b/lib/opencdk/hash.c
index a5c5dc05a8..afc5c990c2 100644
--- a/lib/opencdk/hash.c
+++ b/lib/opencdk/hash.c
@@ -33,27 +33,27 @@
#include "filters.h"
static cdk_error_t
-hash_encode (void *opaque, FILE *in, FILE *out)
+hash_encode (void *opaque, FILE * in, FILE * out)
{
md_filter_t *mfx = opaque;
byte buf[BUFSIZE];
int err;
int nread;
-
+
if (!mfx)
return CDK_Inv_Value;
-
+
_cdk_log_debug ("hash filter: encode algo=%d\n", mfx->digest_algo);
-
+
if (!mfx->md_initialized)
{
err = _gnutls_hash_init (&mfx->md, mfx->digest_algo);
if (err < 0)
return map_gnutls_error (err);
-
+
mfx->md_initialized = 1;
}
-
+
while (!feof (in))
{
nread = fread (buf, 1, BUFSIZE, in);
@@ -61,26 +61,26 @@ hash_encode (void *opaque, FILE *in, FILE *out)
break;
_gnutls_hash (&mfx->md, buf, nread);
}
-
+
wipemem (buf, sizeof (buf));
return 0;
}
cdk_error_t
-_cdk_filter_hash (void *opaque, int ctl, FILE *in, FILE *out)
+_cdk_filter_hash (void *opaque, int ctl, FILE * in, FILE * out)
{
if (ctl == STREAMCTL_READ)
return hash_encode (opaque, in, out);
else if (ctl == STREAMCTL_FREE)
{
md_filter_t *mfx = opaque;
- if (mfx)
+ if (mfx)
{
_cdk_log_debug ("free hash filter\n");
_gnutls_hash_deinit (&mfx->md, NULL);
mfx->md_initialized = 0;
return 0;
- }
+ }
}
return CDK_Inv_Mode;
}