int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
{
unsigned char *p;
+ int objsize;
if ((a == NULL) || (a->data == NULL)) return(0);
- if (pp == NULL)
- return(ASN1_object_size(0,a->length,V_ASN1_OBJECT));
+ objsize = ASN1_object_size(0,a->length,V_ASN1_OBJECT);
+ if (pp == NULL) return objsize;
p= *pp;
ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
p+=a->length;
*pp=p;
- return(a->length);
+ return(objsize);
}
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
if ((a == NULL) || (a->data == NULL))
return(BIO_write(bp,"NULL",4));
- i=i2t_ASN1_OBJECT(buf,80,a);
- if (i > 80) i=80;
+ i=i2t_ASN1_OBJECT(buf,sizeof buf,a);
+ if (i > (int)sizeof(buf)) i=sizeof buf;
BIO_write(bp,buf,i);
return(i);
}
-ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
+ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
long length)
{
- unsigned char *p;
+ const unsigned char *p;
long len;
int tag,xclass;
int inf,i;
ASN1_OBJECT_free(ret);
return(NULL);
}
-ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
+ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
long len)
{
ASN1_OBJECT *ret=NULL;
- unsigned char *p;
+ const unsigned char *p;
int i;
/* only the ASN1_OBJECTs from the 'table' will have values
*pp=p;
return(ret);
err:
- ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
+ ASN1err(ASN1_F_C2I_ASN1_OBJECT,i);
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
ASN1_OBJECT_free(ret);
return(NULL);
}
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
- char *sn, char *ln)
+ const char *sn, const char *ln)
{
ASN1_OBJECT o;