Lines Matching refs:db

38 static int get_index(CA_DB *db, char *id, char type)
45 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
46 pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
52 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
53 pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
64 static void print_entry(CA_DB *db, int indx, int verbose, char *s)
68 char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
76 static void print_index(CA_DB *db, int indexindex, int verbose)
78 print_entry(db, indexindex, verbose, "g N entry");
81 static void print_user(CA_DB *db, int userindex, int verbose)
84 char **pp = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
87 print_entry(db, userindex, verbose, "User entry");
88 print_entry(db, get_index(db, pp[DB_srpgN], 'I'), verbose,
95 static int update_index(CA_DB *db, char **row)
105 if (!TXT_DB_insert(db->db, irow)) {
107 BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
235 CA_DB *db = NULL;
381 db = load_index(srpvfile, NULL);
382 if (db == NULL) {
388 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
389 pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
396 print_index(db, i, verbose > 1);
404 gNrow = sk_OPENSSL_PSTRING_value(db->db->data, gNindex);
405 print_entry(db, gNindex, verbose > 1, "Default g and N");
423 if ((userindex = get_index(db, user, 'U')) >= 0)
424 print_user(db, userindex, (verbose > 0) || mode == OPT_LIST);
430 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
431 print_user(db, i, 1);
441 sk_OPENSSL_PSTRING_value(db->db->data, userindex);
476 || !update_index(db, row)) {
496 sk_OPENSSL_PSTRING_value(db->db->data, userindex);
514 get_index(db, row[DB_srpgN], DB_SRP_INDEX)) >= 0)
516 sk_OPENSSL_PSTRING_value(db->db->data,
572 char **xpp = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
591 for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
592 pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
596 print_user(db, i, verbose);
602 if (!save_index(srpvfile, "new", db))
628 free_index(db);