diff options
Diffstat (limited to 'src/usr.bin/openssl/apps.c')
| -rw-r--r-- | src/usr.bin/openssl/apps.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index d652abc549..8cef15fbb1 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: apps.c,v 1.24 2015/01/03 03:03:39 lteo Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.25 2015/02/07 04:09:43 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -1384,7 +1384,7 @@ static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING) | |||
| 1384 | static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) | 1384 | static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING) |
| 1385 | static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) | 1385 | static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING) |
| 1386 | 1386 | ||
| 1387 | #define BSIZE 256 | 1387 | #define BUFLEN 256 |
| 1388 | 1388 | ||
| 1389 | BIGNUM * | 1389 | BIGNUM * |
| 1390 | load_serial(char *serialfile, int create, ASN1_INTEGER **retai) | 1390 | load_serial(char *serialfile, int create, ASN1_INTEGER **retai) |
| @@ -1442,7 +1442,7 @@ int | |||
| 1442 | save_serial(char *serialfile, char *suffix, BIGNUM *serial, | 1442 | save_serial(char *serialfile, char *suffix, BIGNUM *serial, |
| 1443 | ASN1_INTEGER **retai) | 1443 | ASN1_INTEGER **retai) |
| 1444 | { | 1444 | { |
| 1445 | char buf[1][BSIZE]; | 1445 | char buf[1][BUFLEN]; |
| 1446 | BIO *out = NULL; | 1446 | BIO *out = NULL; |
| 1447 | int ret = 0, n; | 1447 | int ret = 0, n; |
| 1448 | ASN1_INTEGER *ai = NULL; | 1448 | ASN1_INTEGER *ai = NULL; |
| @@ -1452,12 +1452,12 @@ save_serial(char *serialfile, char *suffix, BIGNUM *serial, | |||
| 1452 | j = strlen(serialfile); | 1452 | j = strlen(serialfile); |
| 1453 | else | 1453 | else |
| 1454 | j = strlen(serialfile) + strlen(suffix) + 1; | 1454 | j = strlen(serialfile) + strlen(suffix) + 1; |
| 1455 | if (j >= BSIZE) { | 1455 | if (j >= BUFLEN) { |
| 1456 | BIO_printf(bio_err, "file name too long\n"); | 1456 | BIO_printf(bio_err, "file name too long\n"); |
| 1457 | goto err; | 1457 | goto err; |
| 1458 | } | 1458 | } |
| 1459 | if (suffix == NULL) | 1459 | if (suffix == NULL) |
| 1460 | n = strlcpy(buf[0], serialfile, BSIZE); | 1460 | n = strlcpy(buf[0], serialfile, BUFLEN); |
| 1461 | else | 1461 | else |
| 1462 | n = snprintf(buf[0], sizeof buf[0], "%s.%s", | 1462 | n = snprintf(buf[0], sizeof buf[0], "%s.%s", |
| 1463 | serialfile, suffix); | 1463 | serialfile, suffix); |
| @@ -1498,14 +1498,14 @@ err: | |||
| 1498 | int | 1498 | int |
| 1499 | rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) | 1499 | rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) |
| 1500 | { | 1500 | { |
| 1501 | char buf[5][BSIZE]; | 1501 | char buf[5][BUFLEN]; |
| 1502 | int i, j; | 1502 | int i, j; |
| 1503 | 1503 | ||
| 1504 | i = strlen(serialfile) + strlen(old_suffix); | 1504 | i = strlen(serialfile) + strlen(old_suffix); |
| 1505 | j = strlen(serialfile) + strlen(new_suffix); | 1505 | j = strlen(serialfile) + strlen(new_suffix); |
| 1506 | if (i > j) | 1506 | if (i > j) |
| 1507 | j = i; | 1507 | j = i; |
| 1508 | if (j + 1 >= BSIZE) { | 1508 | if (j + 1 >= BUFLEN) { |
| 1509 | BIO_printf(bio_err, "file name too long\n"); | 1509 | BIO_printf(bio_err, "file name too long\n"); |
| 1510 | goto err; | 1510 | goto err; |
| 1511 | } | 1511 | } |
| @@ -1570,7 +1570,7 @@ load_index(char *dbfile, DB_ATTR *db_attr) | |||
| 1570 | TXT_DB *tmpdb = NULL; | 1570 | TXT_DB *tmpdb = NULL; |
| 1571 | BIO *in = BIO_new(BIO_s_file()); | 1571 | BIO *in = BIO_new(BIO_s_file()); |
| 1572 | CONF *dbattr_conf = NULL; | 1572 | CONF *dbattr_conf = NULL; |
| 1573 | char buf[1][BSIZE]; | 1573 | char buf[1][BUFLEN]; |
| 1574 | long errorline = -1; | 1574 | long errorline = -1; |
| 1575 | 1575 | ||
| 1576 | if (in == NULL) { | 1576 | if (in == NULL) { |
| @@ -1650,7 +1650,7 @@ index_index(CA_DB *db) | |||
| 1650 | int | 1650 | int |
| 1651 | save_index(const char *dbfile, const char *suffix, CA_DB *db) | 1651 | save_index(const char *dbfile, const char *suffix, CA_DB *db) |
| 1652 | { | 1652 | { |
| 1653 | char buf[3][BSIZE]; | 1653 | char buf[3][BUFLEN]; |
| 1654 | BIO *out = BIO_new(BIO_s_file()); | 1654 | BIO *out = BIO_new(BIO_s_file()); |
| 1655 | int j; | 1655 | int j; |
| 1656 | 1656 | ||
| @@ -1659,7 +1659,7 @@ save_index(const char *dbfile, const char *suffix, CA_DB *db) | |||
| 1659 | goto err; | 1659 | goto err; |
| 1660 | } | 1660 | } |
| 1661 | j = strlen(dbfile) + strlen(suffix); | 1661 | j = strlen(dbfile) + strlen(suffix); |
| 1662 | if (j + 6 >= BSIZE) { | 1662 | if (j + 6 >= BUFLEN) { |
| 1663 | BIO_printf(bio_err, "file name too long\n"); | 1663 | BIO_printf(bio_err, "file name too long\n"); |
| 1664 | goto err; | 1664 | goto err; |
| 1665 | } | 1665 | } |
| @@ -1700,14 +1700,14 @@ err: | |||
| 1700 | int | 1700 | int |
| 1701 | rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) | 1701 | rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix) |
| 1702 | { | 1702 | { |
| 1703 | char buf[5][BSIZE]; | 1703 | char buf[5][BUFLEN]; |
| 1704 | int i, j; | 1704 | int i, j; |
| 1705 | 1705 | ||
| 1706 | i = strlen(dbfile) + strlen(old_suffix); | 1706 | i = strlen(dbfile) + strlen(old_suffix); |
| 1707 | j = strlen(dbfile) + strlen(new_suffix); | 1707 | j = strlen(dbfile) + strlen(new_suffix); |
| 1708 | if (i > j) | 1708 | if (i > j) |
| 1709 | j = i; | 1709 | j = i; |
| 1710 | if (j + 6 >= BSIZE) { | 1710 | if (j + 6 >= BUFLEN) { |
| 1711 | BIO_printf(bio_err, "file name too long\n"); | 1711 | BIO_printf(bio_err, "file name too long\n"); |
| 1712 | goto err; | 1712 | goto err; |
| 1713 | } | 1713 | } |
