Update to OpenSSL 1.0.2.o
This commit is contained in:
70
apps/apps.c
70
apps/apps.c
@@ -148,6 +148,10 @@
|
||||
#ifdef _WIN32
|
||||
static int WIN32_rename(const char *from, const char *to);
|
||||
# define rename(from,to) WIN32_rename((from),(to))
|
||||
# ifdef fileno
|
||||
# undef fileno
|
||||
# endif
|
||||
# define fileno(a) (int)_fileno(a)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
@@ -1734,9 +1738,9 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
|
||||
BUF_strlcpy(buf[0], serialfile, BSIZE);
|
||||
else {
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
|
||||
#endif
|
||||
}
|
||||
#ifdef RL_DEBUG
|
||||
@@ -1785,14 +1789,14 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix)
|
||||
goto err;
|
||||
}
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, new_suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", serialfile, old_suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
|
||||
@@ -1873,9 +1877,9 @@ CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
|
||||
goto err;
|
||||
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
BIO_snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
|
||||
BIO_snprintf(buf[0], sizeof(buf[0]), "%s.attr", dbfile);
|
||||
#else
|
||||
BIO_snprintf(buf[0], sizeof buf[0], "%s-attr", dbfile);
|
||||
BIO_snprintf(buf[0], sizeof(buf[0]), "%s-attr", dbfile);
|
||||
#endif
|
||||
dbattr_conf = NCONF_new(NULL);
|
||||
if (NCONF_load(dbattr_conf, buf[0], &errorline) <= 0) {
|
||||
@@ -1963,19 +1967,19 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
||||
goto err;
|
||||
}
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
|
||||
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr", dbfile);
|
||||
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr", dbfile);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.attr.%s", dbfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-attr-%s", dbfile, suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-attr-%s", dbfile, suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, suffix);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
|
||||
@@ -2024,29 +2028,29 @@ int rotate_index(const char *dbfile, const char *new_suffix,
|
||||
goto err;
|
||||
}
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
|
||||
j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s.attr", dbfile);
|
||||
#else
|
||||
j = BIO_snprintf(buf[4], sizeof buf[4], "%s-attr", dbfile);
|
||||
j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s-attr", dbfile);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr.%s", dbfile, new_suffix);
|
||||
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr.%s", dbfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr-%s", dbfile, new_suffix);
|
||||
j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr-%s", dbfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, new_suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, new_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, new_suffix);
|
||||
j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, new_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", dbfile, old_suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", dbfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", dbfile, old_suffix);
|
||||
j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", dbfile, old_suffix);
|
||||
#endif
|
||||
#ifndef OPENSSL_SYS_VMS
|
||||
j = BIO_snprintf(buf[3], sizeof buf[3], "%s.attr.%s", dbfile, old_suffix);
|
||||
j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s.attr.%s", dbfile, old_suffix);
|
||||
#else
|
||||
j = BIO_snprintf(buf[3], sizeof buf[3], "%s-attr-%s", dbfile, old_suffix);
|
||||
j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s-attr-%s", dbfile, old_suffix);
|
||||
#endif
|
||||
#ifdef RL_DEBUG
|
||||
BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", dbfile, buf[1]);
|
||||
@@ -2600,7 +2604,7 @@ static void jpake_send_step3a(BIO *bconn, JPAKE_CTX *ctx)
|
||||
|
||||
JPAKE_STEP3A_init(&s3a);
|
||||
JPAKE_STEP3A_generate(&s3a, ctx);
|
||||
BIO_write(bconn, s3a.hhk, sizeof s3a.hhk);
|
||||
BIO_write(bconn, s3a.hhk, sizeof(s3a.hhk));
|
||||
(void)BIO_flush(bconn);
|
||||
JPAKE_STEP3A_release(&s3a);
|
||||
}
|
||||
@@ -2611,7 +2615,7 @@ static void jpake_send_step3b(BIO *bconn, JPAKE_CTX *ctx)
|
||||
|
||||
JPAKE_STEP3B_init(&s3b);
|
||||
JPAKE_STEP3B_generate(&s3b, ctx);
|
||||
BIO_write(bconn, s3b.hk, sizeof s3b.hk);
|
||||
BIO_write(bconn, s3b.hk, sizeof(s3b.hk));
|
||||
(void)BIO_flush(bconn);
|
||||
JPAKE_STEP3B_release(&s3b);
|
||||
}
|
||||
@@ -2621,7 +2625,7 @@ static void readbn(BIGNUM **bn, BIO *bconn)
|
||||
char buf[10240];
|
||||
int l;
|
||||
|
||||
l = BIO_gets(bconn, buf, sizeof buf);
|
||||
l = BIO_gets(bconn, buf, sizeof(buf));
|
||||
assert(l > 0);
|
||||
assert(buf[l - 1] == '\n');
|
||||
buf[l - 1] = '\0';
|
||||
@@ -2668,8 +2672,8 @@ static void jpake_receive_step3a(JPAKE_CTX *ctx, BIO *bconn)
|
||||
int l;
|
||||
|
||||
JPAKE_STEP3A_init(&s3a);
|
||||
l = BIO_read(bconn, s3a.hhk, sizeof s3a.hhk);
|
||||
assert(l == sizeof s3a.hhk);
|
||||
l = BIO_read(bconn, s3a.hhk, sizeof(s3a.hhk));
|
||||
assert(l == sizeof(s3a.hhk));
|
||||
if (!JPAKE_STEP3A_process(ctx, &s3a)) {
|
||||
ERR_print_errors(bio_err);
|
||||
exit(1);
|
||||
@@ -2683,8 +2687,8 @@ static void jpake_receive_step3b(JPAKE_CTX *ctx, BIO *bconn)
|
||||
int l;
|
||||
|
||||
JPAKE_STEP3B_init(&s3b);
|
||||
l = BIO_read(bconn, s3b.hk, sizeof s3b.hk);
|
||||
assert(l == sizeof s3b.hk);
|
||||
l = BIO_read(bconn, s3b.hk, sizeof(s3b.hk));
|
||||
assert(l == sizeof(s3b.hk));
|
||||
if (!JPAKE_STEP3B_process(ctx, &s3b)) {
|
||||
ERR_print_errors(bio_err);
|
||||
exit(1);
|
||||
@@ -2788,13 +2792,13 @@ unsigned char *next_protos_parse(unsigned short *outlen, const char *in)
|
||||
OPENSSL_free(out);
|
||||
return NULL;
|
||||
}
|
||||
out[start] = i - start;
|
||||
out[start] = (unsigned char)(i - start);
|
||||
start = i + 1;
|
||||
} else
|
||||
out[i + 1] = in[i];
|
||||
}
|
||||
|
||||
*outlen = len + 1;
|
||||
*outlen = (unsigned char)(len + 1);
|
||||
return out;
|
||||
}
|
||||
#endif /* ndef OPENSSL_NO_TLSEXT */
|
||||
|
||||
Reference in New Issue
Block a user