aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgp-decrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgcrypto/pgp-decrypt.c')
-rw-r--r--contrib/pgcrypto/pgp-decrypt.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/pgcrypto/pgp-decrypt.c b/contrib/pgcrypto/pgp-decrypt.c
index c9aa6cd66aa..2063e8c319e 100644
--- a/contrib/pgcrypto/pgp-decrypt.c
+++ b/contrib/pgcrypto/pgp-decrypt.c
@@ -210,7 +210,7 @@ pktreader_free(void *priv)
{
struct PktData *pkt = priv;
- memset(pkt, 0, sizeof(*pkt));
+ px_memset(pkt, 0, sizeof(*pkt));
px_free(pkt);
}
@@ -257,7 +257,7 @@ prefix_init(void **priv_p, void *arg, PullFilter *src)
if (res != len + 2)
{
px_debug("prefix_init: short read");
- memset(tmpbuf, 0, sizeof(tmpbuf));
+ px_memset(tmpbuf, 0, sizeof(tmpbuf));
return PXE_PGP_CORRUPT_DATA;
}
@@ -280,7 +280,7 @@ prefix_init(void **priv_p, void *arg, PullFilter *src)
*/
ctx->corrupt_prefix = 1;
}
- memset(tmpbuf, 0, sizeof(tmpbuf));
+ px_memset(tmpbuf, 0, sizeof(tmpbuf));
return 0;
}
@@ -395,8 +395,8 @@ mdc_finish(PGP_Context *ctx, PullFilter *src,
*/
px_md_finish(ctx->mdc_ctx, hash);
res = memcmp(hash, *data_p, 20);
- memset(hash, 0, 20);
- memset(tmpbuf, 0, sizeof(tmpbuf));
+ px_memset(hash, 0, 20);
+ px_memset(tmpbuf, 0, sizeof(tmpbuf));
if (res != 0)
{
px_debug("mdc_finish: mdc failed");
@@ -493,7 +493,7 @@ mdcbuf_finish(struct MDCBufData * st)
px_md_update(st->ctx->mdc_ctx, st->mdc_buf, 2);
px_md_finish(st->ctx->mdc_ctx, hash);
res = memcmp(hash, st->mdc_buf + 2, 20);
- memset(hash, 0, 20);
+ px_memset(hash, 0, 20);
if (res)
{
px_debug("mdcbuf_finish: MDC does not match");
@@ -593,7 +593,7 @@ mdcbuf_free(void *priv)
px_md_free(st->ctx->mdc_ctx);
st->ctx->mdc_ctx = NULL;
- memset(st, 0, sizeof(*st));
+ px_memset(st, 0, sizeof(*st));
px_free(st);
}
@@ -703,7 +703,7 @@ parse_symenc_sesskey(PGP_Context *ctx, PullFilter *src)
res = decrypt_key(ctx, p, res);
}
- memset(tmpbuf, 0, sizeof(tmpbuf));
+ px_memset(tmpbuf, 0, sizeof(tmpbuf));
return res;
}
@@ -753,6 +753,7 @@ copy_crlf(MBuf *dst, uint8 *data, int len, int *got_cr)
if (res < 0)
return res;
}
+ px_memset(tmpbuf, 0, sizeof(tmpbuf));
return 0;
}
@@ -792,7 +793,7 @@ parse_literal_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
px_debug("parse_literal_data: unexpected eof");
return PXE_PGP_CORRUPT_DATA;
}
- memset(tmpbuf, 0, 4);
+ px_memset(tmpbuf, 0, 4);
/* check if text */
if (ctx->text_mode)