summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/isakmpd/x509.c')
-rw-r--r--sbin/isakmpd/x509.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sbin/isakmpd/x509.c b/sbin/isakmpd/x509.c
index 52d6b8f152c..24f9e07b38c 100644
--- a/sbin/isakmpd/x509.c
+++ b/sbin/isakmpd/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.104 2005/11/14 23:25:11 deraadt Exp $ */
+/* $OpenBSD: x509.c,v 1.105 2005/11/15 21:49:04 cloder Exp $ */
/* $EOM: x509.c,v 1.54 2001/01/16 18:42:16 ho Exp $ */
/*
@@ -1283,21 +1283,13 @@ x509_printable(void *cert)
{
char *s;
u_int8_t *data;
- u_int32_t datalen, i;
+ u_int32_t datalen;
x509_serialize(cert, &data, &datalen);
if (!data)
return 0;
- s = malloc(datalen * 2 + 1);
- if (!s) {
- free(data);
- log_error("x509_printable: malloc (%d) failed",
- datalen * 2 + 1);
- return 0;
- }
- for (i = 0; i < datalen; i++)
- snprintf(s + (2 * i), 2 * (datalen - i) + 1, "%02x", data[i]);
+ s = raw2hex(data, datalen);
free(data);
return s;
}