Loading crypto/asn1/f_enum.c +11 −14 Original line number Diff line number Diff line Loading @@ -97,7 +97,6 @@ int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) { int ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -108,16 +107,16 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) bufsize = BIO_gets(bp, buf, size); for (;;) { if (bufsize < 1) goto err_sl; goto err; i = bufsize; 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) goto err_sl; goto err; again = (buf[i - 1] == '\\'); for (j = 0; j < i; j++) { Loading @@ -133,7 +132,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) * 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; if (first) { Loading @@ -147,7 +146,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) i -= again; if (i % 2 != 0) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_ODD_NUMBER_OF_CHARS); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -155,7 +154,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); OPENSSL_free(s); goto err; return 0; } s = sp; slen = num + i * 2; Loading @@ -172,7 +171,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) else { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_NON_HEX_CHARACTERS); goto err; return 0; } s[num + j] <<= 4; s[num + j] |= m; Loading @@ -186,11 +185,9 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); } return (ret); return 0; } crypto/asn1/f_int.c +9 −13 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) { int ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -112,16 +111,16 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) bufsize = BIO_gets(bp, buf, size); for (;;) { if (bufsize < 1) goto err_sl; goto err; i = bufsize; 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) goto err_sl; goto err; again = (buf[i - 1] == '\\'); for (j = 0; j < i; j++) { Loading @@ -147,7 +146,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) * 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; if (first) { Loading @@ -161,7 +160,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) i -= again; if (i % 2 != 0) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_ODD_NUMBER_OF_CHARS); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -169,7 +168,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); OPENSSL_free(s); goto err; return 0; } s = sp; slen = num + i * 2; Loading Loading @@ -200,11 +199,8 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); } return (ret); return 0; } crypto/asn1/f_string.c +11 −14 Original line number Diff line number Diff line Loading @@ -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 ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -107,7 +106,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) if (first) break; else goto err_sl; goto err; } first = 0; Loading @@ -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) goto err_sl; goto err; 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--) { Loading @@ -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) goto err_sl; goto err; bufp = (unsigned char *)buf; Loading @@ -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); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -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); goto err; return 0; } s = sp; slen = num + i * 2; Loading @@ -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); goto err; return 0; } s[num + j] <<= 4; s[num + j] |= m; Loading @@ -192,11 +191,9 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); } return (ret); return 0; } crypto/asn1/t_x509.c +5 −6 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) { char *s, *c, *b; int ret = 0, l, i; int l, i; l = 80 - 2 - obase; Loading Loading @@ -535,11 +535,10 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) l--; } ret = 1; if (0) { OPENSSL_free(b); return 1; err: X509err(X509_F_X509_NAME_PRINT, ERR_R_BUF_LIB); } OPENSSL_free(b); return (ret); return 0; } crypto/dh/dh_ameth.c +6 −6 Original line number Diff line number Diff line Loading @@ -327,7 +327,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, ASN1_PCTX *ctx, int ptype) { unsigned char *m = NULL; int reason = ERR_R_BUF_LIB, ret = 0; int reason = ERR_R_BUF_LIB; size_t buf_len = 0; const char *ktype = NULL; Loading Loading @@ -415,13 +415,13 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, goto err; } ret = 1; if (0) { OPENSSL_free(m); return 1; err: DHerr(DH_F_DO_DH_PRINT, reason); } OPENSSL_free(m); return (ret); return 0; } static int int_dh_size(const EVP_PKEY *pkey) Loading Loading
crypto/asn1/f_enum.c +11 −14 Original line number Diff line number Diff line Loading @@ -97,7 +97,6 @@ int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) { int ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -108,16 +107,16 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) bufsize = BIO_gets(bp, buf, size); for (;;) { if (bufsize < 1) goto err_sl; goto err; i = bufsize; 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) goto err_sl; goto err; again = (buf[i - 1] == '\\'); for (j = 0; j < i; j++) { Loading @@ -133,7 +132,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) * 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; if (first) { Loading @@ -147,7 +146,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) i -= again; if (i % 2 != 0) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_ODD_NUMBER_OF_CHARS); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -155,7 +154,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); OPENSSL_free(s); goto err; return 0; } s = sp; slen = num + i * 2; Loading @@ -172,7 +171,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) else { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_NON_HEX_CHARACTERS); goto err; return 0; } s[num + j] <<= 4; s[num + j] |= m; Loading @@ -186,11 +185,9 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); } return (ret); return 0; }
crypto/asn1/f_int.c +9 −13 Original line number Diff line number Diff line Loading @@ -101,7 +101,6 @@ int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) { int ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -112,16 +111,16 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) bufsize = BIO_gets(bp, buf, size); for (;;) { if (bufsize < 1) goto err_sl; goto err; i = bufsize; 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) goto err_sl; goto err; again = (buf[i - 1] == '\\'); for (j = 0; j < i; j++) { Loading @@ -147,7 +146,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) * 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; if (first) { Loading @@ -161,7 +160,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) i -= again; if (i % 2 != 0) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_ODD_NUMBER_OF_CHARS); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -169,7 +168,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); OPENSSL_free(s); goto err; return 0; } s = sp; slen = num + i * 2; Loading Loading @@ -200,11 +199,8 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); } return (ret); return 0; }
crypto/asn1/f_string.c +11 −14 Original line number Diff line number Diff line Loading @@ -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 ret = 0; int i, j, k, m, n, again, bufsize; unsigned char *s = NULL, *sp; unsigned char *bufp; Loading @@ -107,7 +106,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) if (first) break; else goto err_sl; goto err; } first = 0; Loading @@ -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) goto err_sl; goto err; 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--) { Loading @@ -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) goto err_sl; goto err; bufp = (unsigned char *)buf; Loading @@ -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); goto err; return 0; } i /= 2; if (num + i > slen) { Loading @@ -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); goto err; return 0; } s = sp; slen = num + i * 2; Loading @@ -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); goto err; return 0; } s[num + j] <<= 4; s[num + j] |= m; Loading @@ -192,11 +191,9 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) } bs->length = num; bs->data = s; ret = 1; return 1; err: if (0) { err_sl: ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); } return (ret); return 0; }
crypto/asn1/t_x509.c +5 −6 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm) int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) { char *s, *c, *b; int ret = 0, l, i; int l, i; l = 80 - 2 - obase; Loading Loading @@ -535,11 +535,10 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) l--; } ret = 1; if (0) { OPENSSL_free(b); return 1; err: X509err(X509_F_X509_NAME_PRINT, ERR_R_BUF_LIB); } OPENSSL_free(b); return (ret); return 0; }
crypto/dh/dh_ameth.c +6 −6 Original line number Diff line number Diff line Loading @@ -327,7 +327,7 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, ASN1_PCTX *ctx, int ptype) { unsigned char *m = NULL; int reason = ERR_R_BUF_LIB, ret = 0; int reason = ERR_R_BUF_LIB; size_t buf_len = 0; const char *ktype = NULL; Loading Loading @@ -415,13 +415,13 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, goto err; } ret = 1; if (0) { OPENSSL_free(m); return 1; err: DHerr(DH_F_DO_DH_PRINT, reason); } OPENSSL_free(m); return (ret); return 0; } static int int_dh_size(const EVP_PKEY *pkey) Loading