projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add OSSL_NELEM macro.
[oweals/openssl.git]
/
crypto
/
asn1
/
asn1_par.c
diff --git
a/crypto/asn1/asn1_par.c
b/crypto/asn1/asn1_par.c
index b12edf9c4a360b12f75cb11df0c5cc4be9082399..574e8de86704630c68441c171d2665b8571dc6e0 100644
(file)
--- a/
crypto/asn1/asn1_par.c
+++ b/
crypto/asn1/asn1_par.c
@@
-215,15
+215,11
@@
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
goto end;
}
} else if (tag == V_ASN1_BOOLEAN) {
goto end;
}
} else if (tag == V_ASN1_BOOLEAN) {
- int ii;
-
- opp = op;
- ii = d2i_ASN1_BOOLEAN(NULL, &opp, len + hl);
- if (ii < 0) {
+ if (len != 1) {
if (BIO_write(bp, "Bad boolean\n", 12) <= 0)
goto end;
}
if (BIO_write(bp, "Bad boolean\n", 12) <= 0)
goto end;
}
- BIO_printf(bp, ":%
d", ii
);
+ BIO_printf(bp, ":%
u", p[0]
);
} else if (tag == V_ASN1_BMPSTRING) {
/* do the BMP thang */
} else if (tag == V_ASN1_OCTET_STRING) {
} else if (tag == V_ASN1_BMPSTRING) {
/* do the BMP thang */
} else if (tag == V_ASN1_OCTET_STRING) {
@@
-280,10
+276,8
@@
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
nl = 1;
}
}
nl = 1;
}
}
- if (os != NULL) {
- M_ASN1_OCTET_STRING_free(os);
- os = NULL;
- }
+ ASN1_OCTET_STRING_free(os);
+ os = NULL;
} else if (tag == V_ASN1_INTEGER) {
ASN1_INTEGER *bs;
int i;
} else if (tag == V_ASN1_INTEGER) {
ASN1_INTEGER *bs;
int i;
@@
-308,7
+302,7
@@
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
if (BIO_write(bp, "BAD INTEGER", 11) <= 0)
goto end;
}
if (BIO_write(bp, "BAD INTEGER", 11) <= 0)
goto end;
}
-
M_
ASN1_INTEGER_free(bs);
+ ASN1_INTEGER_free(bs);
} else if (tag == V_ASN1_ENUMERATED) {
ASN1_ENUMERATED *bs;
int i;
} else if (tag == V_ASN1_ENUMERATED) {
ASN1_ENUMERATED *bs;
int i;
@@
-333,7
+327,7
@@
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0)
goto end;
}
if (BIO_write(bp, "BAD ENUMERATED", 14) <= 0)
goto end;
}
-
M_
ASN1_ENUMERATED_free(bs);
+ ASN1_ENUMERATED_free(bs);
} else if (len > 0 && dump) {
if (!nl) {
if (BIO_write(bp, "\n", 1) <= 0)
} else if (len > 0 && dump) {
if (!nl) {
if (BIO_write(bp, "\n", 1) <= 0)
@@
-360,10
+354,8
@@
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
}
ret = 1;
end:
}
ret = 1;
end:
- if (o != NULL)
- ASN1_OBJECT_free(o);
- if (os != NULL)
- M_ASN1_OCTET_STRING_free(os);
+ ASN1_OBJECT_free(o);
+ ASN1_OCTET_STRING_free(os);
*pp = p;
return (ret);
}
*pp = p;
return (ret);
}