aboutsummaryrefslogtreecommitdiffstats
path: root/g10/textfilter.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/textfilter.c')
-rw-r--r--g10/textfilter.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/g10/textfilter.c b/g10/textfilter.c
index 8665a7200..daa57de0a 100644
--- a/g10/textfilter.c
+++ b/g10/textfilter.c
@@ -26,9 +26,9 @@
#include <errno.h>
#include <assert.h>
+#include "gpg.h"
#include "errors.h"
#include "iobuf.h"
-#include "memory.h"
#include "util.h"
#include "filter.h"
#include "i18n.h"
@@ -162,13 +162,13 @@ text_filter( void *opaque, int control,
* md is updated as required by rfc2440
*/
int
-copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
+copy_clearsig_text( IOBUF out, IOBUF inp, gcry_md_hd_t md,
int escape_dash, int escape_from, int pgp2mode )
{
- unsigned maxlen;
+ unsigned int maxlen;
byte *buffer = NULL; /* malloced buffer */
- unsigned bufsize; /* and size of this buffer */
- unsigned n;
+ unsigned int bufsize; /* and size of this buffer */
+ unsigned int n;
int truncated = 0;
int pending_lf = 0;
@@ -192,15 +192,16 @@ copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
/* update the message digest */
if( escape_dash ) {
if( pending_lf ) {
- md_putc( md, '\r' );
- md_putc( md, '\n' );
+ gcry_md_putc ( md, '\r' );
+ gcry_md_putc ( md, '\n' );
}
- md_write( md, buffer,
- len_without_trailing_chars( buffer, n,
- pgp2mode? " \r\n":" \t\r\n"));
+ gcry_md_write ( md, buffer,
+ len_without_trailing_chars (buffer, n,
+ pgp2mode?
+ " \r\n":" \t\r\n"));
}
else
- md_write( md, buffer, n );
+ gcry_md_write ( md, buffer, n );
pending_lf = buffer[n-1] == '\n';
/* write the output */
@@ -241,7 +242,7 @@ copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
if( !pending_lf ) { /* make sure that the file ends with a LF */
iobuf_writestr( out, LF );
if( !escape_dash )
- md_putc( md, '\n' );
+ gcry_md_putc( md, '\n' );
}
if( truncated )