projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix typo, add prototype
[oweals/openssl.git]
/
crypto
/
asn1
/
a_object.c
diff --git
a/crypto/asn1/a_object.c
b/crypto/asn1/a_object.c
index 3873b98902e2abc0d3b310db9f9a2444e08ebe50..3e6531481b39bbfbd86c4976a632b1b30290b58f 100644
(file)
--- a/
crypto/asn1/a_object.c
+++ b/
crypto/asn1/a_object.c
@@
-65,11
+65,12
@@
int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
{
unsigned char *p;
int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
{
unsigned char *p;
+ int objsize;
if ((a == NULL) || (a->data == NULL)) return(0);
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= *pp;
ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
@@
-77,7
+78,7
@@
int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
p+=a->length;
*pp=p;
p+=a->length;
*pp=p;
- return(
a->length
);
+ return(
objsize
);
}
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
}
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
@@
-182,16
+183,16
@@
int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
if ((a == NULL) || (a->data == NULL))
return(BIO_write(bp,"NULL",4));
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);
}
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)
{
long length)
{
- unsigned char *p;
+
const
unsigned char *p;
long len;
int tag,xclass;
int inf,i;
long len;
int tag,xclass;
int inf,i;
@@
-218,11
+219,11
@@
err:
ASN1_OBJECT_free(ret);
return(NULL);
}
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;
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
int i;
/* only the ASN1_OBJECTs from the 'table' will have values
@@
-254,7
+255,7
@@
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
*pp=p;
return(ret);
err:
*pp=p;
return(ret);
err:
- ASN1err(ASN1_F_
D
2I_ASN1_OBJECT,i);
+ ASN1err(ASN1_F_
C
2I_ASN1_OBJECT,i);
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
ASN1_OBJECT_free(ret);
return(NULL);
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
ASN1_OBJECT_free(ret);
return(NULL);
@@
-301,7
+302,7
@@
void ASN1_OBJECT_free(ASN1_OBJECT *a)
}
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
}
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
- c
har *sn,
char *ln)
+ c
onst char *sn, const
char *ln)
{
ASN1_OBJECT o;
{
ASN1_OBJECT o;