Browse Source

Error codes are uint32_t, not unsigned long.

Fix a few remnants of them being unsigned long. Also rename extremely unhelpful
variable names in SSL_get_error. i is now ret_code to match the header.

Change-Id: Ic31d6626bfe09c9e21c03691dfc716c5573833ea
Reviewed-on: https://boringssl-review.googlesource.com/3881
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 9 years ago
committed by Adam Langley
parent
commit
1a5c50f3a8
3 changed files with 9 additions and 9 deletions
  1. +1
    -1
      crypto/asn1/a_d2i_fp.c
  2. +1
    -1
      crypto/bn/bn_test.c
  3. +7
    -7
      ssl/ssl_lib.c

+ 1
- 1
crypto/asn1/a_d2i_fp.c View File

@@ -194,7 +194,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb)
len-off); len-off);
if (c.inf & 0x80) if (c.inf & 0x80)
{ {
unsigned long e;
uint32_t e;


e=ERR_GET_REASON(ERR_peek_error()); e=ERR_GET_REASON(ERR_peek_error());
if (e != ASN1_R_TOO_LONG) if (e != ASN1_R_TOO_LONG)


+ 1
- 1
crypto/bn/bn_test.c View File

@@ -968,7 +968,7 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx) {
a->neg = rand_neg(); a->neg = rand_neg();
b->neg = rand_neg(); b->neg = rand_neg();
if (!BN_mod_mul(e, a, b, c, ctx)) { if (!BN_mod_mul(e, a, b, c, ctx)) {
unsigned long l;
uint32_t l;


while ((l = ERR_get_error())) { while ((l = ERR_get_error())) {
fprintf(stderr, "ERROR:%s\n", ERR_error_string(l, NULL)); fprintf(stderr, "ERROR:%s\n", ERR_error_string(l, NULL));


+ 7
- 7
ssl/ssl_lib.c View File

@@ -2205,26 +2205,26 @@ void ssl_update_cache(SSL *s, int mode) {
} }
} }


int SSL_get_error(const SSL *s, int i) {
int SSL_get_error(const SSL *s, int ret_code) {
int reason; int reason;
unsigned long l;
uint32_t err;
BIO *bio; BIO *bio;


if (i > 0) {
if (ret_code > 0) {
return SSL_ERROR_NONE; return SSL_ERROR_NONE;
} }


/* Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc, /* Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc,
* where we do encode the error */ * where we do encode the error */
l = ERR_peek_error();
if (l != 0) {
if (ERR_GET_LIB(l) == ERR_LIB_SYS) {
err = ERR_peek_error();
if (err != 0) {
if (ERR_GET_LIB(err) == ERR_LIB_SYS) {
return SSL_ERROR_SYSCALL; return SSL_ERROR_SYSCALL;
} }
return SSL_ERROR_SSL; return SSL_ERROR_SSL;
} }


if (i == 0) {
if (ret_code == 0) {
if ((s->shutdown & SSL_RECEIVED_SHUTDOWN) && if ((s->shutdown & SSL_RECEIVED_SHUTDOWN) &&
(s->s3->warn_alert == SSL_AD_CLOSE_NOTIFY)) { (s->s3->warn_alert == SSL_AD_CLOSE_NOTIFY)) {
/* The socket was cleanly shut down with a close_notify. */ /* The socket was cleanly shut down with a close_notify. */


Loading…
Cancel
Save