int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
	{
#ifdef CHARSET_EBCDIC
	/* KLUDGE! We convert to ascii before writing DER */
	int len;
	char tmp[24];
	ASN1_STRING tmpstr = *(ASN1_STRING *)a;

	len = tmpstr.length;
	ebcdic2ascii(tmp, tmpstr.data, (len >= sizeof tmp) ? sizeof tmp : len);
	tmpstr.data = tmp;

	a = (ASN1_GENERALIZEDTIME *) &tmpstr;
#endif
	return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
		V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL));
	}
int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
	{
#ifdef CHARSET_EBCDIC
	 
	int len;
	char tmp[24];
	ASN1_STRING tmpstr = *(ASN1_STRING *)a;

	len = tmpstr.length;
	ebcdic2ascii(tmp, tmpstr.data, (len >= sizeof tmp) ? sizeof tmp : len);
	tmpstr.data = tmp;

	a = (ASN1_GENERALIZEDTIME *) &tmpstr;
#endif
	return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
		V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL));
	}