summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/x_long.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-02-08 13:07:04 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-02-08 13:07:04 +0000
commit9e5df8e44849d0113e3b5530478dcaeac401fc64 (patch)
treec559bc0ab897ea6da3bd79fe4dc1ca8d2d9b4f3d /crypto/asn1/x_long.c
parent96d13fe62b71dcb08b02ca3ce299b12630326cac (diff)
Support custom primitive type printing routines and add one to LONG type.
Diffstat (limited to 'crypto/asn1/x_long.c')
-rw-r--r--crypto/asn1/x_long.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c
index 0db233cb95..6c7fc2213f 100644
--- a/crypto/asn1/x_long.c
+++ b/crypto/asn1/x_long.c
@@ -71,6 +71,7 @@ static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it);
static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
+static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx);
static ASN1_PRIMITIVE_FUNCS long_pf = {
NULL, 0,
@@ -78,7 +79,8 @@ static ASN1_PRIMITIVE_FUNCS long_pf = {
long_free,
long_free, /* Clear should set to initial value */
long_c2i,
- long_i2c
+ long_i2c,
+ long_print
};
ASN1_ITEM_start(LONG)
@@ -169,3 +171,9 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
memcpy(cp, &ltmp, sizeof(long));
return 1;
}
+
+static int long_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it,
+ int indent, const ASN1_PCTX *pctx)
+ {
+ return BIO_printf(out, "%ld\n", *(long *)pval);
+ }