summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/src/apps/apps.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/lib/libssl/src/apps/apps.c b/src/lib/libssl/src/apps/apps.c
index 75f9fae77c..438af9f635 100644
--- a/src/lib/libssl/src/apps/apps.c
+++ b/src/lib/libssl/src/apps/apps.c
@@ -148,13 +148,13 @@ typedef struct {
148static UI_METHOD *ui_method = NULL; 148static UI_METHOD *ui_method = NULL;
149 149
150static int set_table_opts(unsigned long *flags, const char *arg, 150static int set_table_opts(unsigned long *flags, const char *arg,
151 const NAME_EX_TBL * in_tbl); 151 const NAME_EX_TBL *in_tbl);
152static int set_multi_opts(unsigned long *flags, const char *arg, 152static int set_multi_opts(unsigned long *flags, const char *arg,
153 const NAME_EX_TBL * in_tbl); 153 const NAME_EX_TBL *in_tbl);
154 154
155#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA) 155#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
156/* Looks like this stuff is worth moving into separate function */ 156/* Looks like this stuff is worth moving into separate function */
157static EVP_PKEY *load_netscape_key(BIO * err, BIO * key, const char *file, 157static EVP_PKEY *load_netscape_key(BIO *err, BIO *key, const char *file,
158 const char *key_descrip, int format); 158 const char *key_descrip, int format);
159#endif 159#endif
160 160
@@ -202,7 +202,7 @@ program_name(char *in, char *out, int size)
202} 202}
203 203
204int 204int
205chopup_args(ARGS * arg, char *buf, int *argc, char **argv[]) 205chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
206{ 206{
207 int num, i; 207 int num, i;
208 char *p; 208 char *p;
@@ -271,7 +271,7 @@ chopup_args(ARGS * arg, char *buf, int *argc, char **argv[])
271} 271}
272 272
273int 273int
274dump_cert_text(BIO * out, X509 * x) 274dump_cert_text(BIO *out, X509 *x)
275{ 275{
276 char *p; 276 char *p;
277 277
@@ -290,13 +290,13 @@ dump_cert_text(BIO * out, X509 * x)
290} 290}
291 291
292static int 292static int
293ui_open(UI * ui) 293ui_open(UI *ui)
294{ 294{
295 return UI_method_get_opener(UI_OpenSSL()) (ui); 295 return UI_method_get_opener(UI_OpenSSL()) (ui);
296} 296}
297 297
298static int 298static int
299ui_read(UI * ui, UI_STRING * uis) 299ui_read(UI *ui, UI_STRING *uis)
300{ 300{
301 if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD && 301 if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD &&
302 UI_get0_user_data(ui)) { 302 UI_get0_user_data(ui)) {
@@ -320,7 +320,7 @@ ui_read(UI * ui, UI_STRING * uis)
320} 320}
321 321
322static int 322static int
323ui_write(UI * ui, UI_STRING * uis) 323ui_write(UI *ui, UI_STRING *uis)
324{ 324{
325 if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD && 325 if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD &&
326 UI_get0_user_data(ui)) { 326 UI_get0_user_data(ui)) {
@@ -342,7 +342,7 @@ ui_write(UI * ui, UI_STRING * uis)
342} 342}
343 343
344static int 344static int
345ui_close(UI * ui) 345ui_close(UI *ui)
346{ 346{
347 return UI_method_get_closer(UI_OpenSSL()) (ui); 347 return UI_method_get_closer(UI_OpenSSL()) (ui);
348} 348}
@@ -368,7 +368,7 @@ destroy_ui_method(void)
368} 368}
369 369
370int 370int
371password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA * cb_tmp) 371password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
372{ 372{
373 UI *ui = NULL; 373 UI *ui = NULL;
374 int res = 0; 374 int res = 0;
@@ -438,10 +438,10 @@ password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA * cb_tmp)
438 return res; 438 return res;
439} 439}
440 440
441static char *app_get_pass(BIO * err, char *arg, int keepbio); 441static char *app_get_pass(BIO *err, char *arg, int keepbio);
442 442
443int 443int
444app_passwd(BIO * err, char *arg1, char *arg2, char **pass1, char **pass2) 444app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2)
445{ 445{
446 int same; 446 int same;
447 447
@@ -465,7 +465,7 @@ app_passwd(BIO * err, char *arg1, char *arg2, char **pass1, char **pass2)
465} 465}
466 466
467static char * 467static char *
468app_get_pass(BIO * err, char *arg, int keepbio) 468app_get_pass(BIO *err, char *arg, int keepbio)
469{ 469{
470 char *tmp, tpass[APP_PASS_LEN]; 470 char *tmp, tpass[APP_PASS_LEN];
471 static BIO *pwdbio = NULL; 471 static BIO *pwdbio = NULL;
@@ -535,10 +535,10 @@ app_get_pass(BIO * err, char *arg, int keepbio)
535} 535}
536 536
537int 537int
538add_oid_section(BIO * err, CONF * conf) 538add_oid_section(BIO *err, CONF *conf)
539{ 539{
540 char *p; 540 char *p;
541 STACK_OF(CONF_VALUE) * sktmp; 541 STACK_OF(CONF_VALUE) *sktmp;
542 CONF_VALUE *cnf; 542 CONF_VALUE *cnf;
543 int i; 543 int i;
544 544
@@ -562,8 +562,8 @@ add_oid_section(BIO * err, CONF * conf)
562} 562}
563 563
564static int 564static int
565load_pkcs12(BIO * err, BIO * in, const char *desc, pem_password_cb * pem_cb, 565load_pkcs12(BIO *err, BIO *in, const char *desc, pem_password_cb *pem_cb,
566 void *cb_data, EVP_PKEY ** pkey, X509 ** cert, STACK_OF(X509) ** ca) 566 void *cb_data, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
567{ 567{
568 const char *pass; 568 const char *pass;
569 char tpass[PEM_BUFSIZE]; 569 char tpass[PEM_BUFSIZE];
@@ -605,7 +605,7 @@ die:
605} 605}
606 606
607X509 * 607X509 *
608load_cert(BIO * err, const char *file, int format, const char *pass, ENGINE * e, 608load_cert(BIO *err, const char *file, int format, const char *pass, ENGINE *e,
609 const char *cert_descrip) 609 const char *cert_descrip)
610{ 610{
611 X509 *x = NULL; 611 X509 *x = NULL;
@@ -670,8 +670,8 @@ end:
670} 670}
671 671
672EVP_PKEY * 672EVP_PKEY *
673load_key(BIO * err, const char *file, int format, int maybe_stdin, 673load_key(BIO *err, const char *file, int format, int maybe_stdin,
674 const char *pass, ENGINE * e, const char *key_descrip) 674 const char *pass, ENGINE *e, const char *key_descrip)
675{ 675{
676 BIO *key = NULL; 676 BIO *key = NULL;
677 EVP_PKEY *pkey = NULL; 677 EVP_PKEY *pkey = NULL;
@@ -752,8 +752,8 @@ end:
752} 752}
753 753
754EVP_PKEY * 754EVP_PKEY *
755load_pubkey(BIO * err, const char *file, int format, int maybe_stdin, 755load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
756 const char *pass, ENGINE * e, const char *key_descrip) 756 const char *pass, ENGINE *e, const char *key_descrip)
757{ 757{
758 BIO *key = NULL; 758 BIO *key = NULL;
759 EVP_PKEY *pkey = NULL; 759 EVP_PKEY *pkey = NULL;
@@ -843,7 +843,7 @@ end:
843 843
844#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA) 844#if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
845static EVP_PKEY * 845static EVP_PKEY *
846load_netscape_key(BIO * err, BIO * key, const char *file, 846load_netscape_key(BIO *err, BIO *key, const char *file,
847 const char *key_descrip, int format) 847 const char *key_descrip, int format)
848{ 848{
849 EVP_PKEY *pkey; 849 EVP_PKEY *pkey;
@@ -887,13 +887,13 @@ error:
887#endif /* ndef OPENSSL_NO_RC4 */ 887#endif /* ndef OPENSSL_NO_RC4 */
888 888
889static int 889static int
890load_certs_crls(BIO * err, const char *file, int format, const char *pass, 890load_certs_crls(BIO *err, const char *file, int format, const char *pass,
891 ENGINE * e, const char *desc, STACK_OF(X509) ** pcerts, 891 ENGINE *e, const char *desc, STACK_OF(X509) **pcerts,
892 STACK_OF(X509_CRL) ** pcrls) 892 STACK_OF(X509_CRL) **pcrls)
893{ 893{
894 int i; 894 int i;
895 BIO *bio; 895 BIO *bio;
896 STACK_OF(X509_INFO) * xis = NULL; 896 STACK_OF(X509_INFO) *xis = NULL;
897 X509_INFO *xi; 897 X509_INFO *xi;
898 PW_CB_DATA cb_data; 898 PW_CB_DATA cb_data;
899 int rv = 0; 899 int rv = 0;
@@ -972,10 +972,10 @@ end:
972} 972}
973 973
974STACK_OF(X509) * 974STACK_OF(X509) *
975load_certs(BIO * err, const char *file, int format, const char *pass, 975load_certs(BIO *err, const char *file, int format, const char *pass,
976 ENGINE * e, const char *desc) 976 ENGINE *e, const char *desc)
977{ 977{
978 STACK_OF(X509) * certs; 978 STACK_OF(X509) *certs;
979 979
980 if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL)) 980 if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL))
981 return NULL; 981 return NULL;
@@ -983,10 +983,10 @@ load_certs(BIO * err, const char *file, int format, const char *pass,
983} 983}
984 984
985STACK_OF(X509_CRL) * 985STACK_OF(X509_CRL) *
986load_crls(BIO * err, const char *file, int format, const char *pass, ENGINE * e, 986load_crls(BIO *err, const char *file, int format, const char *pass, ENGINE *e,
987 const char *desc) 987 const char *desc)
988{ 988{
989 STACK_OF(X509_CRL) * crls; 989 STACK_OF(X509_CRL) *crls;
990 990
991 if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls)) 991 if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls))
992 return NULL; 992 return NULL;
@@ -1084,9 +1084,9 @@ set_ext_copy(int *copy_type, const char *arg)
1084} 1084}
1085 1085
1086int 1086int
1087copy_extensions(X509 * x, X509_REQ * req, int copy_type) 1087copy_extensions(X509 *x, X509_REQ *req, int copy_type)
1088{ 1088{
1089 STACK_OF(X509_EXTENSION) * exts = NULL; 1089 STACK_OF(X509_EXTENSION) *exts = NULL;
1090 X509_EXTENSION *ext, *tmpext; 1090 X509_EXTENSION *ext, *tmpext;
1091 ASN1_OBJECT *obj; 1091 ASN1_OBJECT *obj;
1092 int i, idx, ret = 0; 1092 int i, idx, ret = 0;
@@ -1126,9 +1126,9 @@ end:
1126 1126
1127static int 1127static int
1128set_multi_opts(unsigned long *flags, const char *arg, 1128set_multi_opts(unsigned long *flags, const char *arg,
1129 const NAME_EX_TBL * in_tbl) 1129 const NAME_EX_TBL *in_tbl)
1130{ 1130{
1131 STACK_OF(CONF_VALUE) * vals; 1131 STACK_OF(CONF_VALUE) *vals;
1132 CONF_VALUE *val; 1132 CONF_VALUE *val;
1133 int i, ret = 1; 1133 int i, ret = 1;
1134 1134
@@ -1146,7 +1146,7 @@ set_multi_opts(unsigned long *flags, const char *arg,
1146 1146
1147static int 1147static int
1148set_table_opts(unsigned long *flags, const char *arg, 1148set_table_opts(unsigned long *flags, const char *arg,
1149 const NAME_EX_TBL * in_tbl) 1149 const NAME_EX_TBL *in_tbl)
1150{ 1150{
1151 char c; 1151 char c;
1152 const NAME_EX_TBL *ptbl; 1152 const NAME_EX_TBL *ptbl;
@@ -1175,7 +1175,7 @@ set_table_opts(unsigned long *flags, const char *arg,
1175} 1175}
1176 1176
1177void 1177void
1178print_name(BIO * out, const char *title, X509_NAME * nm, unsigned long lflags) 1178print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags)
1179{ 1179{
1180 char *buf; 1180 char *buf;
1181 char mline = 0; 1181 char mline = 0;
@@ -1201,7 +1201,7 @@ print_name(BIO * out, const char *title, X509_NAME * nm, unsigned long lflags)
1201} 1201}
1202 1202
1203X509_STORE * 1203X509_STORE *
1204setup_verify(BIO * bp, char *CAfile, char *CApath) 1204setup_verify(BIO *bp, char *CAfile, char *CApath)
1205{ 1205{
1206 X509_STORE *store; 1206 X509_STORE *store;
1207 X509_LOOKUP *lookup; 1207 X509_LOOKUP *lookup;
@@ -1241,7 +1241,7 @@ end:
1241#ifndef OPENSSL_NO_ENGINE 1241#ifndef OPENSSL_NO_ENGINE
1242/* Try to load an engine in a shareable library */ 1242/* Try to load an engine in a shareable library */
1243static ENGINE * 1243static ENGINE *
1244try_load_engine(BIO * err, const char *engine, int debug) 1244try_load_engine(BIO *err, const char *engine, int debug)
1245{ 1245{
1246 ENGINE *e = ENGINE_by_id("dynamic"); 1246 ENGINE *e = ENGINE_by_id("dynamic");
1247 1247
@@ -1256,7 +1256,7 @@ try_load_engine(BIO * err, const char *engine, int debug)
1256} 1256}
1257 1257
1258ENGINE * 1258ENGINE *
1259setup_engine(BIO * err, const char *engine, int debug) 1259setup_engine(BIO *err, const char *engine, int debug)
1260{ 1260{
1261 ENGINE *e = NULL; 1261 ENGINE *e = NULL;
1262 1262
@@ -1293,7 +1293,7 @@ setup_engine(BIO * err, const char *engine, int debug)
1293#endif 1293#endif
1294 1294
1295int 1295int
1296load_config(BIO * err, CONF * cnf) 1296load_config(BIO *err, CONF *cnf)
1297{ 1297{
1298 static int load_config_called = 0; 1298 static int load_config_called = 0;
1299 1299
@@ -1327,7 +1327,7 @@ make_config_name()
1327} 1327}
1328 1328
1329static unsigned long 1329static unsigned long
1330index_serial_hash(const OPENSSL_CSTRING * a) 1330index_serial_hash(const OPENSSL_CSTRING *a)
1331{ 1331{
1332 const char *n; 1332 const char *n;
1333 1333
@@ -1338,7 +1338,7 @@ index_serial_hash(const OPENSSL_CSTRING * a)
1338} 1338}
1339 1339
1340static int 1340static int
1341index_serial_cmp(const OPENSSL_CSTRING * a, const OPENSSL_CSTRING * b) 1341index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
1342{ 1342{
1343 const char *aa, *bb; 1343 const char *aa, *bb;
1344 1344
@@ -1356,13 +1356,13 @@ index_name_qual(char **a)
1356} 1356}
1357 1357
1358static unsigned long 1358static unsigned long
1359index_name_hash(const OPENSSL_CSTRING * a) 1359index_name_hash(const OPENSSL_CSTRING *a)
1360{ 1360{
1361 return (lh_strhash(a[DB_name])); 1361 return (lh_strhash(a[DB_name]));
1362} 1362}
1363 1363
1364int 1364int
1365index_name_cmp(const OPENSSL_CSTRING * a, const OPENSSL_CSTRING * b) 1365index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
1366{ 1366{
1367 return (strcmp(a[DB_name], b[DB_name])); 1367 return (strcmp(a[DB_name], b[DB_name]));
1368} 1368}
@@ -1375,7 +1375,7 @@ static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)
1375#define BSIZE 256 1375#define BSIZE 256
1376 1376
1377BIGNUM * 1377BIGNUM *
1378load_serial(char *serialfile, int create, ASN1_INTEGER ** retai) 1378load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1379{ 1379{
1380 BIO *in = NULL; 1380 BIO *in = NULL;
1381 BIGNUM *ret = NULL; 1381 BIGNUM *ret = NULL;
@@ -1427,8 +1427,8 @@ err:
1427} 1427}
1428 1428
1429int 1429int
1430save_serial(char *serialfile, char *suffix, BIGNUM * serial, 1430save_serial(char *serialfile, char *suffix, BIGNUM *serial,
1431 ASN1_INTEGER ** retai) 1431 ASN1_INTEGER **retai)
1432{ 1432{
1433 char buf[1][BSIZE]; 1433 char buf[1][BSIZE];
1434 BIO *out = NULL; 1434 BIO *out = NULL;
@@ -1535,7 +1535,7 @@ err:
1535} 1535}
1536 1536
1537int 1537int
1538rand_serial(BIGNUM * b, ASN1_INTEGER * ai) 1538rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
1539{ 1539{
1540 BIGNUM *btmp; 1540 BIGNUM *btmp;
1541 int ret = 0; 1541 int ret = 0;
@@ -1563,7 +1563,7 @@ error:
1563} 1563}
1564 1564
1565CA_DB * 1565CA_DB *
1566load_index(char *dbfile, DB_ATTR * db_attr) 1566load_index(char *dbfile, DB_ATTR *db_attr)
1567{ 1567{
1568 CA_DB *retdb = NULL; 1568 CA_DB *retdb = NULL;
1569 TXT_DB *tmpdb = NULL; 1569 TXT_DB *tmpdb = NULL;
@@ -1631,7 +1631,7 @@ err:
1631} 1631}
1632 1632
1633int 1633int
1634index_index(CA_DB * db) 1634index_index(CA_DB *db)
1635{ 1635{
1636 if (!TXT_DB_create_index(db->db, DB_serial, NULL, 1636 if (!TXT_DB_create_index(db->db, DB_serial, NULL,
1637 LHASH_HASH_FN(index_serial), LHASH_COMP_FN(index_serial))) { 1637 LHASH_HASH_FN(index_serial), LHASH_COMP_FN(index_serial))) {
@@ -1651,7 +1651,7 @@ index_index(CA_DB * db)
1651} 1651}
1652 1652
1653int 1653int
1654save_index(const char *dbfile, const char *suffix, CA_DB * db) 1654save_index(const char *dbfile, const char *suffix, CA_DB *db)
1655{ 1655{
1656 char buf[3][BSIZE]; 1656 char buf[3][BSIZE];
1657 BIO *out = BIO_new(BIO_s_file()); 1657 BIO *out = BIO_new(BIO_s_file());
@@ -1786,7 +1786,7 @@ err:
1786} 1786}
1787 1787
1788void 1788void
1789free_index(CA_DB * db) 1789free_index(CA_DB *db)
1790{ 1790{
1791 if (db) { 1791 if (db) {
1792 if (db->db) 1792 if (db->db)
@@ -1946,8 +1946,8 @@ error:
1946} 1946}
1947 1947
1948int 1948int
1949args_verify(char ***pargs, int *pargc, int *badarg, BIO * err, 1949args_verify(char ***pargs, int *pargc, int *badarg, BIO *err,
1950 X509_VERIFY_PARAM ** pm) 1950 X509_VERIFY_PARAM **pm)
1951{ 1951{
1952 ASN1_OBJECT *otmp = NULL; 1952 ASN1_OBJECT *otmp = NULL;
1953 unsigned long flags = 0; 1953 unsigned long flags = 0;
@@ -2081,7 +2081,7 @@ end:
2081 */ 2081 */
2082 2082
2083int 2083int
2084bio_to_mem(unsigned char **out, int maxlen, BIO * in) 2084bio_to_mem(unsigned char **out, int maxlen, BIO *in)
2085{ 2085{
2086 BIO *mem; 2086 BIO *mem;
2087 int len, ret; 2087 int len, ret;
@@ -2114,7 +2114,7 @@ bio_to_mem(unsigned char **out, int maxlen, BIO * in)
2114} 2114}
2115 2115
2116int 2116int
2117pkey_ctrl_string(EVP_PKEY_CTX * ctx, char *value) 2117pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value)
2118{ 2118{
2119 int rv; 2119 int rv;
2120 char *stmp, *vtmp = NULL; 2120 char *stmp, *vtmp = NULL;
@@ -2134,7 +2134,7 @@ pkey_ctrl_string(EVP_PKEY_CTX * ctx, char *value)
2134} 2134}
2135 2135
2136static void 2136static void
2137nodes_print(BIO * out, const char *name, STACK_OF(X509_POLICY_NODE) * nodes) 2137nodes_print(BIO *out, const char *name, STACK_OF(X509_POLICY_NODE) *nodes)
2138{ 2138{
2139 X509_POLICY_NODE *node; 2139 X509_POLICY_NODE *node;
2140 int i; 2140 int i;
@@ -2151,7 +2151,7 @@ nodes_print(BIO * out, const char *name, STACK_OF(X509_POLICY_NODE) * nodes)
2151} 2151}
2152 2152
2153void 2153void
2154policies_print(BIO * out, X509_STORE_CTX * ctx) 2154policies_print(BIO *out, X509_STORE_CTX *ctx)
2155{ 2155{
2156 X509_POLICY_TREE *tree; 2156 X509_POLICY_TREE *tree;
2157 int explicit_policy; 2157 int explicit_policy;