Skip to content

Commit

Permalink
Update from 1.0.0-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
snhenson committed Jul 27, 2009
1 parent d808660 commit c869da8
Show file tree
Hide file tree
Showing 22 changed files with 302 additions and 302 deletions.
16 changes: 8 additions & 8 deletions apps/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ char *make_config_name()
return p;
}

static unsigned long index_serial_hash(const CSTRING *a)
static unsigned long index_serial_hash(const OPENSSL_CSTRING *a)
{
const char *n;

Expand All @@ -1497,7 +1497,7 @@ static unsigned long index_serial_hash(const CSTRING *a)
return(lh_strhash(n));
}

static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
static int index_serial_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
{
const char *aa,*bb;

Expand All @@ -1509,16 +1509,16 @@ static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
static int index_name_qual(char **a)
{ return(a[0][0] == 'V'); }

static unsigned long index_name_hash(const CSTRING *a)
static unsigned long index_name_hash(const OPENSSL_CSTRING *a)
{ return(lh_strhash(a[DB_name])); }

int index_name_cmp(const CSTRING *a, const CSTRING *b)
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
{ return(strcmp(a[DB_name], b[DB_name])); }

static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING)
static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)

#undef BSIZE
#define BSIZE 256
Expand Down
6 changes: 3 additions & 3 deletions apps/apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db);
int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
void free_index(CA_DB *db);
#define index_name_cmp_noconst(a, b) \
index_name_cmp((const CSTRING *)CHECKED_PTR_OF(STRING, a), \
(const CSTRING *)CHECKED_PTR_OF(STRING, b))
int index_name_cmp(const CSTRING *a, const CSTRING *b);
index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
(const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
int parse_yesno(const char *str, int def);

X509_NAME *parse_name(char *str, long chtype, int multirdn);
Expand Down
16 changes: 8 additions & 8 deletions apps/asn1pars.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int MAIN(int argc, char **argv)
unsigned char *tmpbuf;
const unsigned char *ctmpbuf;
BUF_MEM *buf=NULL;
STACK_OF(STRING) *osk=NULL;
STACK_OF(OPENSSL_STRING) *osk=NULL;
ASN1_TYPE *at=NULL;

informat=FORMAT_PEM;
Expand All @@ -113,7 +113,7 @@ int MAIN(int argc, char **argv)
prog=argv[0];
argc--;
argv++;
if ((osk=sk_STRING_new_null()) == NULL)
if ((osk=sk_OPENSSL_STRING_new_null()) == NULL)
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto end;
Expand Down Expand Up @@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-strparse") == 0)
{
if (--argc < 1) goto bad;
sk_STRING_push(osk,*(++argv));
sk_OPENSSL_STRING_push(osk,*(++argv));
}
else if (strcmp(*argv,"-genstr") == 0)
{
Expand Down Expand Up @@ -302,18 +302,18 @@ int MAIN(int argc, char **argv)

/* If any structs to parse go through in sequence */

if (sk_STRING_num(osk))
if (sk_OPENSSL_STRING_num(osk))
{
tmpbuf=(unsigned char *)str;
tmplen=num;
for (i=0; i<sk_STRING_num(osk); i++)
for (i=0; i<sk_OPENSSL_STRING_num(osk); i++)
{
ASN1_TYPE *atmp;
int typ;
j=atoi(sk_STRING_value(osk,i));
j=atoi(sk_OPENSSL_STRING_value(osk,i));
if (j == 0)
{
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_STRING_value(osk,i));
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_OPENSSL_STRING_value(osk,i));
continue;
}
tmpbuf+=j;
Expand Down Expand Up @@ -378,7 +378,7 @@ int MAIN(int argc, char **argv)
ERR_print_errors(bio_err);
if (buf != NULL) BUF_MEM_free(buf);
if (at != NULL) ASN1_TYPE_free(at);
if (osk != NULL) sk_STRING_free(osk);
if (osk != NULL) sk_OPENSSL_STRING_free(osk);
OBJ_cleanup();
apps_shutdown();
OPENSSL_EXIT(ret);
Expand Down
22 changes: 11 additions & 11 deletions apps/ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,9 @@ EF_ALIGNMENT=0;
if (db == NULL) goto err;

/* Lets check some fields */
for (i=0; i<sk_PSTRING_num(db->db->data); i++)
for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
{
pp=sk_PSTRING_value(db->db->data,i);
pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
if ((pp[DB_type][0] != DB_TYPE_REV) &&
(pp[DB_rev_date][0] != '\0'))
{
Expand Down Expand Up @@ -938,7 +938,7 @@ EF_ALIGNMENT=0;
#endif
TXT_DB_write(out,db->db);
BIO_printf(bio_err,"%d entries loaded from the database\n",
sk_PSTRING_num(db->db->data));
sk_OPENSSL_PSTRING_num(db->db->data));
BIO_printf(bio_err,"generating index\n");
}

Expand Down Expand Up @@ -1408,9 +1408,9 @@ EF_ALIGNMENT=0;

ASN1_TIME_free(tmptm);

for (i=0; i<sk_PSTRING_num(db->db->data); i++)
for (i=0; i<sk_OPENSSL_PSTRING_num(db->db->data); i++)
{
pp=sk_PSTRING_value(db->db->data,i);
pp=sk_OPENSSL_PSTRING_value(db->db->data,i);
if (pp[DB_type][0] == DB_TYPE_REV)
{
if ((r=X509_REVOKED_new()) == NULL) goto err;
Expand Down Expand Up @@ -1685,9 +1685,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
int ok= -1,i,j,last,nid;
const char *p;
CONF_VALUE *cv;
STRING row[DB_NUMBER];
STRING *irow=NULL;
STRING *rrow=NULL;
OPENSSL_STRING row[DB_NUMBER];
OPENSSL_STRING *irow=NULL;
OPENSSL_STRING *rrow=NULL;
char buf[25];

tmptm=ASN1_UTCTIME_new();
Expand Down Expand Up @@ -1929,7 +1929,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,

if (db->attributes.unique_subject)
{
STRING *crow=row;
OPENSSL_STRING *crow=row;

rrow=TXT_DB_get_by_index(db->db,DB_name,crow);
if (rrow != NULL)
Expand Down Expand Up @@ -2632,9 +2632,9 @@ static int do_updatedb (CA_DB *db)
else
a_y2k = 0;

for (i = 0; i < sk_PSTRING_num(db->db->data); i++)
for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++)
{
rrow = sk_PSTRING_value(db->db->data, i);
rrow = sk_OPENSSL_PSTRING_value(db->db->data, i);

if (rrow[DB_type][0] == 'V')
{
Expand Down
64 changes: 32 additions & 32 deletions apps/cms.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
static int cms_cb(int ok, X509_STORE_CTX *ctx);
static void receipt_request_print(BIO *out, CMS_ContentInfo *cms);
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
int rr_allorfirst,
STACK_OF(STRING) *rr_from);
STACK_OF(OPENSSL_STRING) *rr_from);

#define SMIME_OP 0x10
#define SMIME_IP 0x20
Expand Down Expand Up @@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
const char *inmode = "r", *outmode = "w";
char *infile = NULL, *outfile = NULL, *rctfile = NULL;
char *signerfile = NULL, *recipfile = NULL;
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
char *certsoutfile = NULL;
const EVP_CIPHER *cipher = NULL;
Expand All @@ -122,7 +122,7 @@ int MAIN(int argc, char **argv)
int flags = CMS_DETACHED, noout = 0, print = 0;
int verify_retcode = 0;
int rr_print = 0, rr_allorfirst = -1;
STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL;
STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL;
CMS_ReceiptRequest *rr = NULL;
char *to = NULL, *from = NULL, *subject = NULL;
char *CAfile = NULL, *CApath = NULL;
Expand Down Expand Up @@ -281,17 +281,17 @@ int MAIN(int argc, char **argv)
goto argerr;
args++;
if (!rr_from)
rr_from = sk_STRING_new_null();
sk_STRING_push(rr_from, *args);
rr_from = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(rr_from, *args);
}
else if (!strcmp(*args,"-receipt_request_to"))
{
if (!args[1])
goto argerr;
args++;
if (!rr_to)
rr_to = sk_STRING_new_null();
sk_STRING_push(rr_to, *args);
rr_to = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(rr_to, *args);
}
else if (!strcmp (*args, "-print"))
{
Expand Down Expand Up @@ -387,13 +387,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
sksigners = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!keyfile)
keyfile = signerfile;
if (!skkeys)
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
skkeys = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(skkeys, keyfile);
keyfile = NULL;
}
signerfile = *++args;
Expand Down Expand Up @@ -435,12 +435,12 @@ int MAIN(int argc, char **argv)
goto argerr;
}
if (!sksigners)
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
sksigners = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(sksigners, signerfile);
signerfile = NULL;
if (!skkeys)
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
skkeys = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(skkeys, keyfile);
}
keyfile = *++args;
}
Expand Down Expand Up @@ -539,13 +539,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
sksigners = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(sksigners, signerfile);
if (!skkeys)
skkeys = sk_STRING_new_null();
skkeys = sk_OPENSSL_STRING_new_null();
if (!keyfile)
keyfile = signerfile;
sk_STRING_push(skkeys, keyfile);
sk_OPENSSL_STRING_push(skkeys, keyfile);
}
if (!sksigners)
{
Expand Down Expand Up @@ -980,11 +980,11 @@ int MAIN(int argc, char **argv)
}
else
flags |= CMS_REUSE_DIGEST;
for (i = 0; i < sk_STRING_num(sksigners); i++)
for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++)
{
CMS_SignerInfo *si;
signerfile = sk_STRING_value(sksigners, i);
keyfile = sk_STRING_value(skkeys, i);
signerfile = sk_OPENSSL_STRING_value(sksigners, i);
keyfile = sk_OPENSSL_STRING_value(skkeys, i);
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
e, "signer certificate");
if (!signer)
Expand Down Expand Up @@ -1160,9 +1160,9 @@ int MAIN(int argc, char **argv)
if (vpm)
X509_VERIFY_PARAM_free(vpm);
if (sksigners)
sk_STRING_free(sksigners);
sk_OPENSSL_STRING_free(sksigners);
if (skkeys)
sk_STRING_free(skkeys);
sk_OPENSSL_STRING_free(skkeys);
if (secret_key)
OPENSSL_free(secret_key);
if (secret_keyid)
Expand All @@ -1172,9 +1172,9 @@ int MAIN(int argc, char **argv)
if (rr)
CMS_ReceiptRequest_free(rr);
if (rr_to)
sk_STRING_free(rr_to);
sk_OPENSSL_STRING_free(rr_to);
if (rr_from)
sk_STRING_free(rr_from);
sk_OPENSSL_STRING_free(rr_from);
X509_STORE_free(store);
X509_free(cert);
X509_free(recip);
Expand Down Expand Up @@ -1296,7 +1296,7 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
}
}

static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(OPENSSL_STRING) *ns)
{
int i;
STACK_OF(GENERAL_NAMES) *ret;
Expand All @@ -1305,9 +1305,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
ret = sk_GENERAL_NAMES_new_null();
if (!ret)
goto err;
for (i = 0; i < sk_STRING_num(ns); i++)
for (i = 0; i < sk_OPENSSL_STRING_num(ns); i++)
{
char *str = sk_STRING_value(ns, i);
char *str = sk_OPENSSL_STRING_value(ns, i);
gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
if (!gen)
goto err;
Expand Down Expand Up @@ -1335,9 +1335,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
}


static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING) *rr_to,
int rr_allorfirst,
STACK_OF(STRING) *rr_from)
STACK_OF(OPENSSL_STRING) *rr_from)
{
STACK_OF(GENERAL_NAMES) *rct_to, *rct_from;
CMS_ReceiptRequest *rr;
Expand Down
12 changes: 6 additions & 6 deletions apps/crl2p7.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
PKCS7 *p7 = NULL;
PKCS7_SIGNED *p7s = NULL;
X509_CRL *crl=NULL;
STACK_OF(STRING) *certflst=NULL;
STACK_OF(OPENSSL_STRING) *certflst=NULL;
STACK_OF(X509_CRL) *crl_stack=NULL;
STACK_OF(X509) *cert_stack=NULL;
int ret=1,nocrl=0;
Expand Down Expand Up @@ -140,8 +140,8 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-certfile") == 0)
{
if (--argc < 1) goto bad;
if(!certflst) certflst = sk_STRING_new_null();
sk_STRING_push(certflst,*(++argv));
if(!certflst) certflst = sk_OPENSSL_STRING_new_null();
sk_OPENSSL_STRING_push(certflst,*(++argv));
}
else
{
Expand Down Expand Up @@ -226,8 +226,8 @@ int MAIN(int argc, char **argv)
if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
p7s->cert=cert_stack;

if(certflst) for(i = 0; i < sk_STRING_num(certflst); i++) {
certfile = sk_STRING_value(certflst, i);
if(certflst) for(i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
certfile = sk_OPENSSL_STRING_value(certflst, i);
if (add_certs_from_file(cert_stack,certfile) < 0)
{
BIO_printf(bio_err, "error loading certificates\n");
Expand All @@ -236,7 +236,7 @@ int MAIN(int argc, char **argv)
}
}

sk_STRING_free(certflst);
sk_OPENSSL_STRING_free(certflst);

if (outfile == NULL)
{
Expand Down
Loading

0 comments on commit c869da8

Please sign in to comment.