-/* $Cambridge: exim/src/src/pdkim/pdkim.c,v 1.1.2.1 2009/02/24 13:13:47 tom Exp $ */
+/* $Cambridge: exim/src/src/pdkim/pdkim.c,v 1.1.2.2 2009/02/24 15:57:55 tom Exp $ */
/* pdkim.c */
#include <stdlib.h>
/* -------------------------------------------------------------------------- */
-int pdkim_feed_finish(pdkim_ctx *ctx) {
+int pdkim_feed_finish(pdkim_ctx *ctx, char **signature) {
/* Check if we must still flush a (partial) header. If that is the
case, the message has no body, and we must compute a body hash
if (ctx->debug_stream) {
fprintf(ctx->debug_stream,
"PDKIM >> Final DKIM-Signature header >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
- fprintf(ctx->debug_stream,"%s\n",hdr->str);
- //pdkim_quoteprint(ctx->debug_stream, hdr->str, hdr->len, 1);
+ pdkim_quoteprint(ctx->debug_stream, hdr->str, hdr->len, 1);
fprintf(ctx->debug_stream,
"PDKIM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}
#endif
+
+ if (signature != NULL) {
+ *signature = hdr->str;
+ }
+
}
+
return PDKIM_OK;
}
/* -------------------------------------------------------------------------- */
int pdkim_set_optional(pdkim_ctx *ctx,
+ int input_mode,
char *sign_headers,
char *identity,
int canon_headers,
strcpy(ctx->sig->sign_headers, sign_headers);
}
+ ctx->input_mode = input_mode;
ctx->sig->canon_headers = canon_headers;
ctx->sig->canon_body = canon_body;
ctx->sig->bodylength = bodylength;