projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Swap to using _longjmp/_setjmp instead of longjmp/setjmp
[oweals/openssl.git]
/
crypto
/
asn1
/
f_string.c
diff --git
a/crypto/asn1/f_string.c
b/crypto/asn1/f_string.c
index e9dcee8e86f5bd455e7f81ceac30a1b8d3365b64..cecbb4a0b24f9e15225e42a27142c74d0d6e2023 100644
(file)
--- a/
crypto/asn1/f_string.c
+++ b/
crypto/asn1/f_string.c
@@
-57,7
+57,7
@@
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include "cryptlib.h"
+#include "
internal/
cryptlib.h"
#include <openssl/buffer.h>
#include <openssl/asn1.h>
#include <openssl/buffer.h>
#include <openssl/asn1.h>
@@
-95,7
+95,6
@@
int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
{
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
{
- int ret = 0;
int i, j, k, m, n, again, bufsize;
unsigned char *s = NULL, *sp;
unsigned char *bufp;
int i, j, k, m, n, again, bufsize;
unsigned char *s = NULL, *sp;
unsigned char *bufp;
@@
-107,7
+106,7
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
if (first)
break;
else
if (first)
break;
else
- goto err
_sl
;
+ goto err;
}
first = 0;
}
first = 0;
@@
-115,11
+114,11
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
if (buf[i - 1] == '\n')
buf[--i] = '\0';
if (i == 0)
if (buf[i - 1] == '\n')
buf[--i] = '\0';
if (i == 0)
- goto err
_sl
;
+ goto err;
if (buf[i - 1] == '\r')
buf[--i] = '\0';
if (i == 0)
if (buf[i - 1] == '\r')
buf[--i] = '\0';
if (i == 0)
- goto err
_sl
;
+ goto err;
again = (buf[i - 1] == '\\');
for (j = i - 1; j > 0; j--) {
again = (buf[i - 1] == '\\');
for (j = i - 1; j > 0; j--) {
@@
-145,7
+144,7
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
* We have now cleared all the crap off the end of the line
*/
if (i < 2)
* We have now cleared all the crap off the end of the line
*/
if (i < 2)
- goto err
_sl
;
+ goto err;
bufp = (unsigned char *)buf;
bufp = (unsigned char *)buf;
@@
-153,7
+152,7
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
i -= again;
if (i % 2 != 0) {
ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_ODD_NUMBER_OF_CHARS);
i -= again;
if (i % 2 != 0) {
ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_ODD_NUMBER_OF_CHARS);
-
goto err
;
+
return 0
;
}
i /= 2;
if (num + i > slen) {
}
i /= 2;
if (num + i > slen) {
@@
-161,7
+160,7
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE);
OPENSSL_free(s);
if (sp == NULL) {
ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE);
OPENSSL_free(s);
-
goto err
;
+
return 0
;
}
s = sp;
slen = num + i * 2;
}
s = sp;
slen = num + i * 2;
@@
-178,7
+177,7
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
else {
ASN1err(ASN1_F_A2I_ASN1_STRING,
ASN1_R_NON_HEX_CHARACTERS);
else {
ASN1err(ASN1_F_A2I_ASN1_STRING,
ASN1_R_NON_HEX_CHARACTERS);
-
goto err
;
+
return 0
;
}
s[num + j] <<= 4;
s[num + j] |= m;
}
s[num + j] <<= 4;
s[num + j] |= m;
@@
-192,11
+191,9
@@
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
}
bs->length = num;
bs->data = s;
}
bs->length = num;
bs->data = s;
- ret = 1;
+ return 1;
+
err:
err:
- if (0) {
- err_sl:
- ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE);
- }
- return (ret);
+ ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE);
+ return 0;
}
}