提交 5ce278a7 编写于 作者: B Ben Laurie

More type-checking.

上级 37cf49a3
......@@ -4,6 +4,14 @@
Changes between 0.9.8g and 0.9.9 [xx XXX xxxx]
*) Removed effectively defunct crypto/store from the build.
[Ben Laurie]
*) Revamp of STACK to provide stronger type-checking. Still to come:
TXT_DB, bsearch(?), OBJ_bsearch, qsort, CRYPTO_EX_DATA, ASN1_VALUE,
ASN1_STRING, CONF_VALUE.
[Ben Laurie]
*) Add a new SSL_MODE_RELEASE_BUFFERS mode flag to release unused buffer
RAM on SSL connections. This option can save about 34k per idle SSL.
[Nick Mathewson]
......
......@@ -119,7 +119,7 @@ SDIRS= \
bn ec rsa dsa ecdsa dh ecdh dso engine \
buffer bio stack lhash rand err \
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
store cms pqueue ts
cms pqueue ts
# keep in mind that the above list is adjusted by ./Configure
# according to no-xxx arguments...
......
......@@ -362,10 +362,10 @@ dsaparam.o: ../include/openssl/pem.h ../include/openssl/pem2.h
dsaparam.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
dsaparam.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
dsaparam.o: ../include/openssl/sha.h ../include/openssl/stack.h
dsaparam.o: ../include/openssl/store.h ../include/openssl/symhacks.h
dsaparam.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
dsaparam.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
dsaparam.o: ../include/openssl/x509v3.h apps.h dsaparam.c
dsaparam.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
dsaparam.o: ../include/openssl/ui.h ../include/openssl/x509.h
dsaparam.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
dsaparam.o: dsaparam.c
ec.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ec.o: ../include/openssl/buffer.h ../include/openssl/conf.h
ec.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
......@@ -470,10 +470,10 @@ gendh.o: ../include/openssl/pem.h ../include/openssl/pem2.h
gendh.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
gendh.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
gendh.o: ../include/openssl/sha.h ../include/openssl/stack.h
gendh.o: ../include/openssl/store.h ../include/openssl/symhacks.h
gendh.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
gendh.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
gendh.o: ../include/openssl/x509v3.h apps.h gendh.c
gendh.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
gendh.o: ../include/openssl/ui.h ../include/openssl/x509.h
gendh.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
gendh.o: gendh.c
gendsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
gendsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
gendsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
......@@ -522,10 +522,10 @@ genrsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h
genrsa.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
genrsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
genrsa.o: ../include/openssl/sha.h ../include/openssl/stack.h
genrsa.o: ../include/openssl/store.h ../include/openssl/symhacks.h
genrsa.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
genrsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
genrsa.o: ../include/openssl/x509v3.h apps.h genrsa.c
genrsa.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
genrsa.o: ../include/openssl/ui.h ../include/openssl/x509.h
genrsa.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
genrsa.o: genrsa.c
nseq.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
nseq.o: ../include/openssl/buffer.h ../include/openssl/conf.h
nseq.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
......@@ -741,10 +741,9 @@ req.o: ../include/openssl/pem.h ../include/openssl/pem2.h
req.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
req.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
req.o: ../include/openssl/sha.h ../include/openssl/stack.h
req.o: ../include/openssl/store.h ../include/openssl/symhacks.h
req.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
req.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
req.o: ../include/openssl/x509v3.h apps.h req.c
req.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
req.o: ../include/openssl/ui.h ../include/openssl/x509.h
req.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h req.c
rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h
rsa.o: ../include/openssl/conf.h ../include/openssl/crypto.h
......@@ -839,11 +838,11 @@ s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h
s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h
s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h
s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h
s_server.o: ../include/openssl/stack.h ../include/openssl/store.h
s_server.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h
s_server.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
s_server.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
s_server.o: ../include/openssl/x509v3.h apps.h s_apps.h s_server.c timeouts.h
s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
s_server.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h
s_server.o: ../include/openssl/ui.h ../include/openssl/x509.h
s_server.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
s_server.o: s_apps.h s_server.c timeouts.h
s_socket.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
s_socket.o: ../include/openssl/buffer.h ../include/openssl/comp.h
s_socket.o: ../include/openssl/conf.h ../include/openssl/crypto.h
......
......@@ -96,7 +96,7 @@ int MAIN(int argc, char **argv)
unsigned char *tmpbuf;
const unsigned char *ctmpbuf;
BUF_MEM *buf=NULL;
STACK *osk=NULL;
STACK_OF(STRING) *osk=NULL;
ASN1_TYPE *at=NULL;
informat=FORMAT_PEM;
......@@ -113,7 +113,7 @@ int MAIN(int argc, char **argv)
prog=argv[0];
argc--;
argv++;
if ((osk=sk_new_null()) == NULL)
if ((osk=sk_STRING_new_null()) == NULL)
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto end;
......@@ -169,7 +169,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-strparse") == 0)
{
if (--argc < 1) goto bad;
sk_push(osk,*(++argv));
sk_STRING_push(osk,*(++argv));
}
else if (strcmp(*argv,"-genstr") == 0)
{
......@@ -302,18 +302,18 @@ bad:
/* If any structs to parse go through in sequence */
if (sk_num(osk))
if (sk_STRING_num(osk))
{
tmpbuf=(unsigned char *)str;
tmplen=num;
for (i=0; i<sk_num(osk); i++)
for (i=0; i<sk_STRING_num(osk); i++)
{
ASN1_TYPE *atmp;
int typ;
j=atoi(sk_value(osk,i));
j=atoi(sk_STRING_value(osk,i));
if (j == 0)
{
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_value(osk,i));
BIO_printf(bio_err,"'%s' is an invalid number\n",sk_STRING_value(osk,i));
continue;
}
tmpbuf+=j;
......@@ -378,7 +378,7 @@ end:
ERR_print_errors(bio_err);
if (buf != NULL) BUF_MEM_free(buf);
if (at != NULL) ASN1_TYPE_free(at);
if (osk != NULL) sk_free(osk);
if (osk != NULL) sk_STRING_free(osk);
OBJ_cleanup();
apps_shutdown();
OPENSSL_EXIT(ret);
......
......@@ -306,7 +306,8 @@ int MAIN(int argc, char **argv)
ASN1_TIME *tmptm;
ASN1_INTEGER *tmpser;
char *f;
const char *p, **pp;
const char *p;
char * const *pp;
int i,j;
const EVP_MD *dgst=NULL;
STACK_OF(CONF_VALUE) *attribs=NULL;
......@@ -555,8 +556,10 @@ bad:
if (badops)
{
for (pp=ca_usage; (*pp != NULL); pp++)
BIO_printf(bio_err,"%s",*pp);
const char **pp2;
for (pp2=ca_usage; (*pp2 != NULL); pp2++)
BIO_printf(bio_err,"%s",*pp2);
goto err;
}
......@@ -876,9 +879,9 @@ bad:
if (db == NULL) goto err;
/* Lets check some fields */
for (i=0; i<sk_num(db->db->data); i++)
for (i=0; i<sk_PSTRING_num(db->db->data); i++)
{
pp=(const char **)sk_value(db->db->data,i);
pp=sk_PSTRING_value(db->db->data,i);
if ((pp[DB_type][0] != DB_TYPE_REV) &&
(pp[DB_rev_date][0] != '\0'))
{
......@@ -931,7 +934,7 @@ bad:
#endif
TXT_DB_write(out,db->db);
BIO_printf(bio_err,"%d entries loaded from the database\n",
db->db->data->num);
sk_PSTRING_num(db->db->data));
BIO_printf(bio_err,"generating index\n");
}
......@@ -1401,9 +1404,9 @@ bad:
ASN1_TIME_free(tmptm);
for (i=0; i<sk_num(db->db->data); i++)
for (i=0; i<sk_PSTRING_num(db->db->data); i++)
{
pp=(const char **)sk_value(db->db->data,i);
pp=sk_PSTRING_value(db->db->data,i);
if (pp[DB_type][0] == DB_TYPE_REV)
{
if ((r=X509_REVOKED_new()) == NULL) goto err;
......@@ -2630,9 +2633,9 @@ static int do_updatedb (CA_DB *db)
else
a_y2k = 0;
for (i = 0; i < sk_num(db->db->data); i++)
for (i = 0; i < sk_PSTRING_num(db->db->data); i++)
{
rrow = (char **) sk_value(db->db->data, i);
rrow = sk_PSTRING_value(db->db->data, i);
if (rrow[DB_type][0] == 'V')
{
......
......@@ -71,8 +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 *rr_to, int rr_allorfirst,
STACK *rr_from);
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
int rr_allorfirst,
STACK_OF(STRING) *rr_from);
#define SMIME_OP 0x10
#define SMIME_IP 0x20
......@@ -105,7 +106,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 *sksigners = NULL, *skkeys = NULL;
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
char *certsoutfile = NULL;
const EVP_CIPHER *cipher = NULL;
......@@ -118,7 +119,7 @@ int MAIN(int argc, char **argv)
int badarg = 0;
int flags = CMS_DETACHED, noout = 0, print = 0;
int rr_print = 0, rr_allorfirst = -1;
STACK *rr_to = NULL, *rr_from = NULL;
STACK_OF(STRING) *rr_to = NULL, *rr_from = NULL;
CMS_ReceiptRequest *rr = NULL;
char *to = NULL, *from = NULL, *subject = NULL;
char *CAfile = NULL, *CApath = NULL;
......@@ -275,8 +276,8 @@ int MAIN(int argc, char **argv)
goto argerr;
args++;
if (!rr_from)
rr_from = sk_new_null();
sk_push(rr_from, *args);
rr_from = sk_STRING_new_null();
sk_STRING_push(rr_from, *args);
}
else if (!strcmp(*args,"-receipt_request_to"))
{
......@@ -284,8 +285,8 @@ int MAIN(int argc, char **argv)
goto argerr;
args++;
if (!rr_to)
rr_to = sk_new_null();
sk_push(rr_to, *args);
rr_to = sk_STRING_new_null();
sk_STRING_push(rr_to, *args);
}
else if (!strcmp (*args, "-print"))
{
......@@ -381,13 +382,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
if (!keyfile)
keyfile = signerfile;
if (!skkeys)
skkeys = sk_new_null();
sk_push(skkeys, keyfile);
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
keyfile = NULL;
}
signerfile = *++args;
......@@ -429,12 +430,12 @@ int MAIN(int argc, char **argv)
goto argerr;
}
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
signerfile = NULL;
if (!skkeys)
skkeys = sk_new_null();
sk_push(skkeys, keyfile);
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
}
keyfile = *++args;
}
......@@ -533,13 +534,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
if (!skkeys)
skkeys = sk_new_null();
skkeys = sk_STRING_new_null();
if (!keyfile)
keyfile = signerfile;
sk_push(skkeys, keyfile);
sk_STRING_push(skkeys, keyfile);
}
if (!sksigners)
{
......@@ -974,11 +975,11 @@ int MAIN(int argc, char **argv)
}
else
flags |= CMS_REUSE_DIGEST;
for (i = 0; i < sk_num(sksigners); i++)
for (i = 0; i < sk_STRING_num(sksigners); i++)
{
CMS_SignerInfo *si;
signerfile = sk_value(sksigners, i);
keyfile = sk_value(skkeys, i);
signerfile = sk_STRING_value(sksigners, i);
keyfile = sk_STRING_value(skkeys, i);
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
e, "signer certificate");
if (!signer)
......@@ -1152,9 +1153,9 @@ end:
if (vpm)
X509_VERIFY_PARAM_free(vpm);
if (sksigners)
sk_free(sksigners);
sk_STRING_free(sksigners);
if (skkeys)
sk_free(skkeys);
sk_STRING_free(skkeys);
if (secret_key)
OPENSSL_free(secret_key);
if (secret_keyid)
......@@ -1164,9 +1165,9 @@ end:
if (rr)
CMS_ReceiptRequest_free(rr);
if (rr_to)
sk_free(rr_to);
sk_STRING_free(rr_to);
if (rr_from)
sk_free(rr_from);
sk_STRING_free(rr_from);
X509_STORE_free(store);
X509_free(cert);
X509_free(recip);
......@@ -1286,7 +1287,7 @@ static void receipt_request_print(BIO *out, CMS_ContentInfo *cms)
}
}
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK *ns)
static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(STRING) *ns)
{
int i;
STACK_OF(GENERAL_NAMES) *ret;
......@@ -1295,9 +1296,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK *ns)
ret = sk_GENERAL_NAMES_new_null();
if (!ret)
goto err;
for (i = 0; i < sk_num(ns); i++)
for (i = 0; i < sk_STRING_num(ns); i++)
{
char *str = sk_value(ns, i);
char *str = sk_STRING_value(ns, i);
gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
if (!gen)
goto err;
......@@ -1325,8 +1326,9 @@ static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK *ns)
}
static CMS_ReceiptRequest *make_receipt_request(STACK *rr_to, int rr_allorfirst,
STACK *rr_from)
static CMS_ReceiptRequest *make_receipt_request(STACK_OF(STRING) *rr_to,
int rr_allorfirst,
STACK_OF(STRING) *rr_from)
{
STACK_OF(GENERAL_NAMES) *rct_to, *rct_from;
CMS_ReceiptRequest *rr;
......
......@@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
PKCS7 *p7 = NULL;
PKCS7_SIGNED *p7s = NULL;
X509_CRL *crl=NULL;
STACK *certflst=NULL;
STACK_OF(STRING) *certflst=NULL;
STACK_OF(X509_CRL) *crl_stack=NULL;
STACK_OF(X509) *cert_stack=NULL;
int ret=1,nocrl=0;
......@@ -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_new_null();
sk_push(certflst,*(++argv));
if(!certflst) certflst = sk_STRING_new_null();
sk_STRING_push(certflst,*(++argv));
}
else
{
......@@ -226,8 +226,8 @@ bad:
if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
p7s->cert=cert_stack;
if(certflst) for(i = 0; i < sk_num(certflst); i++) {
certfile = sk_value(certflst, i);
if(certflst) for(i = 0; i < sk_STRING_num(certflst); i++) {
certfile = sk_STRING_value(certflst, i);
if (add_certs_from_file(cert_stack,certfile) < 0)
{
BIO_printf(bio_err, "error loading certificates\n");
......@@ -236,7 +236,7 @@ bad:
}
}
sk_free(certflst);
sk_STRING_free(certflst);
if (outfile == NULL)
{
......
......@@ -107,7 +107,7 @@ int MAIN(int argc, char **argv)
#endif
char *hmac_key=NULL;
char *mac_name=NULL;
STACK *sigopts = NULL, *macopts = NULL;
STACK_OF(STRING) *sigopts = NULL, *macopts = NULL;
apps_startup();
......@@ -210,8 +210,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1)
break;
if (!sigopts)
sigopts = sk_new_null();
if (!sigopts || !sk_push(sigopts, *(++argv)))
sigopts = sk_STRING_new_null();
if (!sigopts || !sk_STRING_push(sigopts, *(++argv)))
break;
}
else if (strcmp(*argv,"-macopt") == 0)
......@@ -219,8 +219,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1)
break;
if (!macopts)
macopts = sk_new_null();
if (!macopts || !sk_push(macopts, *(++argv)))
macopts = sk_STRING_new_null();
if (!macopts || !sk_STRING_push(macopts, *(++argv)))
break;
}
else if ((m=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
......@@ -372,9 +372,9 @@ int MAIN(int argc, char **argv)
if (macopts)
{
char *macopt;
for (i = 0; i < sk_num(macopts); i++)
for (i = 0; i < sk_STRING_num(macopts); i++)
{
macopt = sk_value(macopts, i);
macopt = sk_STRING_value(macopts, i);
if (pkey_ctrl_string(mac_ctx, macopt) <= 0)
{
BIO_printf(bio_err,
......@@ -431,9 +431,9 @@ int MAIN(int argc, char **argv)
if (sigopts)
{
char *sigopt;
for (i = 0; i < sk_num(sigopts); i++)
for (i = 0; i < sk_STRING_num(sigopts); i++)
{
sigopt = sk_value(sigopts, i);
sigopt = sk_STRING_value(sigopts, i);
if (pkey_ctrl_string(pctx, sigopt) <= 0)
{
BIO_printf(bio_err,
......@@ -538,9 +538,9 @@ end:
BIO_free_all(out);
EVP_PKEY_free(sigkey);
if (sigopts)
sk_free(sigopts);
sk_STRING_free(sigopts);
if (macopts)
sk_free(macopts);
sk_STRING_free(macopts);
if(sigbuf) OPENSSL_free(sigbuf);
if (bmd != NULL) BIO_free(bmd);
apps_shutdown();
......
......@@ -92,7 +92,7 @@ static const char *engine_usage[]={
NULL
};
static void identity(void *ptr)
static void identity(char *ptr)
{
return;
}
......@@ -200,7 +200,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
char *desc = NULL;
int flags;
int xpos = 0;
STACK *cmds = NULL;
STACK_OF(STRING) *cmds = NULL;
if(!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
0, NULL, NULL)) <= 0))
......@@ -211,7 +211,7 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
return 1;
}
cmds = sk_new_null();
cmds = sk_STRING_new_null();
if(!cmds)
goto err;
......@@ -284,15 +284,17 @@ static int util_verbose(ENGINE *e, int verbose, BIO *bio_out, const char *indent
BIO_printf(bio_out, "\n");
ret = 1;
err:
if(cmds) sk_pop_free(cmds, identity);
if(cmds) sk_STRING_pop_free(cmds, identity);
if(name) OPENSSL_free(name);
if(desc) OPENSSL_free(desc);
return ret;
}
static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *indent)
static void util_do_cmds(ENGINE *e, STACK_OF(STRING) *cmds, BIO *bio_out,
const char *indent)
{
int loop, res, num = sk_num(cmds);
int loop, res, num = sk_STRING_num(cmds);
if(num < 0)
{
BIO_printf(bio_out, "[Error]: internal stack error\n");
......@@ -302,7 +304,7 @@ static void util_do_cmds(ENGINE *e, STACK *cmds, BIO *bio_out, const char *inden
{
char buf[256];
const char *cmd, *arg;
cmd = sk_value(cmds, loop);
cmd = sk_STRING_value(cmds, loop);
res = 1; /* assume success */
/* Check if this command has no ":arg" */
if((arg = strstr(cmd, ":")) == NULL)
......@@ -342,9 +344,9 @@ int MAIN(int argc, char **argv)
const char **pp;
int verbose=0, list_cap=0, test_avail=0, test_avail_noise = 0;
ENGINE *e;
STACK *engines = sk_new_null();
STACK *pre_cmds = sk_new_null();
STACK *post_cmds = sk_new_null();
STACK_OF(STRING) *engines = sk_STRING_new_null();
STACK_OF(STRING) *pre_cmds = sk_STRING_new_null();
STACK_OF(STRING) *post_cmds = sk_STRING_new_null();
int badops=1;
BIO *bio_out=NULL;
const char *indent = " ";
......@@ -391,20 +393,20 @@ int MAIN(int argc, char **argv)
argc--; argv++;
if (argc == 0)
goto skip_arg_loop;
sk_push(pre_cmds,*argv);
sk_STRING_push(pre_cmds,*argv);
}
else if (strcmp(*argv,"-post") == 0)
{
argc--; argv++;
if (argc == 0)
goto skip_arg_loop;
sk_push(post_cmds,*argv);
sk_STRING_push(post_cmds,*argv);
}
else if ((strncmp(*argv,"-h",2) == 0) ||
(strcmp(*argv,"-?") == 0))
goto skip_arg_loop;
else
sk_push(engines,*argv);
sk_STRING_push(engines,*argv);
argc--;
argv++;
}
......@@ -419,17 +421,17 @@ skip_arg_loop:
goto end;
}
if (sk_num(engines) == 0)
if (sk_STRING_num(engines) == 0)
{
for(e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e))
{
sk_push(engines,(char *)ENGINE_get_id(e));
sk_STRING_push(engines,(char *)ENGINE_get_id(e));
}
}
for (i=0; i<sk_num(engines); i++)
for (i=0; i<sk_STRING_num(engines); i++)
{
const char *id = sk_value(engines,i);
const char *id = sk_STRING_value(engines,i);
if ((e = ENGINE_by_id(id)) != NULL)
{
const char *name = ENGINE_get_name(e);
......@@ -531,9 +533,9 @@ skip_pmeths:
end:
ERR_print_errors(bio_err);
sk_pop_free(engines, identity);
sk_pop_free(pre_cmds, identity);
sk_pop_free(post_cmds, identity);
sk_STRING_pop_free(engines, identity);
sk_STRING_pop_free(pre_cmds, identity);
sk_STRING_pop_free(post_cmds, identity);
if (bio_out != NULL) BIO_free_all(bio_out);
apps_shutdown();
OPENSSL_EXIT(ret);
......
......@@ -92,8 +92,9 @@ static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_m
static int add_ocsp_serial(OCSP_REQUEST **req, char *serial, const EVP_MD * cert_id_md, X509 *issuer,
STACK_OF(OCSP_CERTID) *ids);
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
STACK *names, STACK_OF(OCSP_CERTID) *ids,
long nsec, long maxage);
STACK_OF(STRING) *names,
STACK_OF(OCSP_CERTID) *ids, long nsec,
long maxage);
static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, CA_DB *db,
X509 *ca, X509 *rcert, EVP_PKEY *rkey,
......@@ -145,7 +146,7 @@ int MAIN(int argc, char **argv)
int badarg = 0;
int i;
int ignore_err = 0;
STACK *reqnames = NULL;
STACK_OF(STRING) *reqnames = NULL;
STACK_OF(OCSP_CERTID) *ids = NULL;
X509 *rca_cert = NULL;
......@@ -162,7 +163,7 @@ int MAIN(int argc, char **argv)
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
args = argv + 1;
reqnames = sk_new_null();
reqnames = sk_STRING_new_null();
ids = sk_OCSP_CERTID_new_null();
while (!badarg && *args && *args[0] == '-')
{
......@@ -424,7 +425,7 @@ int MAIN(int argc, char **argv)
if (!cert_id_md) cert_id_md = EVP_sha1();
if(!add_ocsp_cert(&req, cert, cert_id_md, issuer, ids))
goto end;
if(!sk_push(reqnames, *args))
if(!sk_STRING_push(reqnames, *args))
goto end;
}
else badarg = 1;
......@@ -437,7 +438,7 @@ int MAIN(int argc, char **argv)
if (!cert_id_md) cert_id_md = EVP_sha1();
if(!add_ocsp_serial(&req, *args, cert_id_md, issuer, ids))
goto end;
if(!sk_push(reqnames, *args))
if(!sk_STRING_push(reqnames, *args))
goto end;
}
else badarg = 1;
......@@ -893,7 +894,7 @@ end:
OCSP_REQUEST_free(req);
OCSP_RESPONSE_free(resp);
OCSP_BASICRESP_free(bs);
sk_free(reqnames);
sk_STRING_free(reqnames);
sk_OCSP_CERTID_free(ids);
sk_X509_pop_free(sign_other, X509_free);
sk_X509_pop_free(verify_other, X509_free);
......@@ -963,8 +964,9 @@ static int add_ocsp_serial(OCSP_REQUEST **req, char *serial,const EVP_MD *cert_i
}
static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
STACK *names, STACK_OF(OCSP_CERTID) *ids,
long nsec, long maxage)
STACK_OF(STRING) *names,
STACK_OF(OCSP_CERTID) *ids, long nsec,
long maxage)
{
OCSP_CERTID *id;
char *name;
......@@ -974,13 +976,13 @@ static int print_ocsp_summary(BIO *out, OCSP_BASICRESP *bs, OCSP_REQUEST *req,
ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd;
if (!bs || !req || !sk_num(names) || !sk_OCSP_CERTID_num(ids))
if (!bs || !req || !sk_STRING_num(names) || !sk_OCSP_CERTID_num(ids))
return 1;
for (i = 0; i < sk_OCSP_CERTID_num(ids); i++)
{
id = sk_OCSP_CERTID_value(ids, i);
name = sk_value(names, i);
name = sk_STRING_value(names, i);
BIO_printf(out, "%s: ", name);
if(!OCSP_resp_find_status(bs, id, &status, &reason,
......
......@@ -116,7 +116,7 @@ int MAIN(int argc, char **argv)
int ret = 1;
int macver = 1;
int noprompt = 0;
STACK *canames = NULL;
STACK_OF(STRING) *canames = NULL;
char *cpass = NULL, *mpass = NULL;
char *passargin = NULL, *passargout = NULL, *passarg = NULL;
char *passin = NULL, *passout = NULL;
......@@ -219,8 +219,8 @@ int MAIN(int argc, char **argv)
} else if (!strcmp (*args, "-caname")) {
if (args[1]) {
args++;
if (!canames) canames = sk_new_null();
sk_push(canames, *args);
if (!canames) canames = sk_STRING_new_null();
sk_STRING_push(canames, *args);
} else badarg = 1;
} else if (!strcmp (*args, "-in")) {
if (args[1]) {
......@@ -545,9 +545,9 @@ int MAIN(int argc, char **argv)
/* Add any CA names */
for (i = 0; i < sk_num(canames); i++)
for (i = 0; i < sk_STRING_num(canames); i++)
{
catmp = (unsigned char *)sk_value(canames, i);
catmp = (unsigned char *)sk_STRING_value(canames, i);
X509_alias_set1(sk_X509_value(certs, i), catmp, -1);
}
......@@ -681,7 +681,7 @@ int MAIN(int argc, char **argv)
#endif
BIO_free(in);
BIO_free_all(out);
if (canames) sk_free(canames);
if (canames) sk_STRING_free(canames);
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
......
......@@ -165,7 +165,7 @@ int MAIN(int argc, char **argv)
EVP_PKEY_CTX *genctx = NULL;
const char *keyalg = NULL;
char *keyalgstr = NULL;
STACK *pkeyopts = NULL;
STACK_OF(STRING) *pkeyopts = NULL;
EVP_PKEY *pkey=NULL;
int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1;
long newkey = -1;
......@@ -306,8 +306,8 @@ int MAIN(int argc, char **argv)
if (--argc < 1)
goto bad;
if (!pkeyopts)
pkeyopts = sk_new_null();
if (!pkeyopts || !sk_push(pkeyopts, *(++argv)))
pkeyopts = sk_STRING_new_null();
if (!pkeyopts || !sk_STRING_push(pkeyopts, *(++argv)))
goto bad;
}
else if (strcmp(*argv,"-batch") == 0)
......@@ -667,9 +667,9 @@ bad:
if (pkeyopts)
{
char *genopt;
for (i = 0; i < sk_num(pkeyopts); i++)
for (i = 0; i < sk_STRING_num(pkeyopts); i++)
{
genopt = sk_value(pkeyopts, i);
genopt = sk_STRING_value(pkeyopts, i);
if (pkey_ctrl_string(genctx, genopt) <= 0)
{
BIO_printf(bio_err,
......@@ -1083,7 +1083,7 @@ end:
if (genctx)
EVP_PKEY_CTX_free(genctx);
if (pkeyopts)
sk_free(pkeyopts);
sk_STRING_free(pkeyopts);
#ifndef OPENSSL_NO_ENGINE
if (gen_eng)
ENGINE_free(gen_eng);
......
......@@ -705,7 +705,7 @@ static int cert_status_cb(SSL *s, void *arg)
int use_ssl;
unsigned char *rspder = NULL;
int rspderlen;
STACK *aia = NULL;
STACK_OF(STRING) *aia = NULL;
X509 *x = NULL;
X509_STORE_CTX inctx;
X509_OBJECT obj;
......@@ -727,7 +727,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
aia = X509_get1_ocsp(x);
if (aia)
{
if (!OCSP_parse_url(sk_value(aia, 0),
if (!OCSP_parse_url(sk_STRING_value(aia, 0),
&host, &port, &path, &use_ssl))
{
BIO_puts(err, "cert_status: can't parse AIA URL\n");
......@@ -735,7 +735,7 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
}
if (srctx->verbose)
BIO_printf(err, "cert_status: AIA URL: %s\n",
sk_value(aia, 0));
sk_STRING_value(aia, 0));
}
else
{
......
......@@ -93,7 +93,7 @@ int MAIN(int argc, char **argv)
const char *inmode = "r", *outmode = "w";
char *infile = NULL, *outfile = NULL;
char *signerfile = NULL, *recipfile = NULL;
STACK *sksigners = NULL, *skkeys = NULL;
STACK_OF(STRING) *sksigners = NULL, *skkeys = NULL;
char *certfile = NULL, *keyfile = NULL, *contfile=NULL;
const EVP_CIPHER *cipher = NULL;
PKCS7 *p7 = NULL;
......@@ -260,13 +260,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
if (!keyfile)
keyfile = signerfile;
if (!skkeys)
skkeys = sk_new_null();
sk_push(skkeys, keyfile);
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
keyfile = NULL;
}
signerfile = *++args;
......@@ -302,12 +302,12 @@ int MAIN(int argc, char **argv)
goto argerr;
}
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
signerfile = NULL;
if (!skkeys)
skkeys = sk_new_null();
sk_push(skkeys, keyfile);
skkeys = sk_STRING_new_null();
sk_STRING_push(skkeys, keyfile);
}
keyfile = *++args;
}
......@@ -389,13 +389,13 @@ int MAIN(int argc, char **argv)
if (signerfile)
{
if (!sksigners)
sksigners = sk_new_null();
sk_push(sksigners, signerfile);
sksigners = sk_STRING_new_null();
sk_STRING_push(sksigners, signerfile);
if (!skkeys)
skkeys = sk_new_null();
skkeys = sk_STRING_new_null();
if (!keyfile)
keyfile = signerfile;
sk_push(skkeys, keyfile);
sk_STRING_push(skkeys, keyfile);
}
if (!sksigners)
{
......@@ -707,10 +707,10 @@ int MAIN(int argc, char **argv)
}
else
flags |= PKCS7_REUSE_DIGEST;
for (i = 0; i < sk_num(sksigners); i++)
for (i = 0; i < sk_STRING_num(sksigners); i++)
{
signerfile = sk_value(sksigners, i);
keyfile = sk_value(skkeys, i);
signerfile = sk_STRING_value(sksigners, i);
keyfile = sk_STRING_value(skkeys, i);
signer = load_cert(bio_err, signerfile,FORMAT_PEM, NULL,
e, "signer certificate");
if (!signer)
......@@ -807,9 +807,9 @@ end:
if (vpm)
X509_VERIFY_PARAM_free(vpm);
if (sksigners)
sk_free(sksigners);
sk_STRING_free(sksigners);
if (skkeys)
sk_free(skkeys);
sk_STRING_free(skkeys);
X509_STORE_free(store);
X509_free(cert);
X509_free(recip);
......
......@@ -738,13 +738,14 @@ bad:
else if ((email == i) || (ocsp_uri == i))
{
int j;
STACK *emlst;
STACK_OF(STRING) *emlst;
if (email == i)
emlst = X509_get1_email(x);
else
emlst = X509_get1_ocsp(x);
for (j = 0; j < sk_num(emlst); j++)
BIO_printf(STDout, "%s\n", sk_value(emlst, j));
for (j = 0; j < sk_STRING_num(emlst); j++)
BIO_printf(STDout, "%s\n",
sk_STRING_value(emlst, j));
X509_email_free(emlst);
}
else if (aliasout == i)
......
......@@ -85,8 +85,9 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
}
/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
int i2d_ASN1_SET(STACK *a, unsigned char **pp, i2d_of_void *i2d, int ex_tag,
int ex_class, int is_set)
int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
i2d_of_void *i2d, int ex_tag, int ex_class,
int is_set)
{
int ret=0,r;
int i;
......@@ -96,8 +97,8 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, i2d_of_void *i2d, int ex_tag,
int totSize;
if (a == NULL) return(0);
for (i=sk_num(a)-1; i>=0; i--)
ret+=i2d(sk_value(a,i),NULL);
for (i=sk_BLOCK_num(a)-1; i>=0; i--)
ret+=i2d(sk_BLOCK_value(a,i),NULL);
r=ASN1_object_size(1,ret,ex_tag);
if (pp == NULL) return(r);
......@@ -108,10 +109,10 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, i2d_of_void *i2d, int ex_tag,
/* And then again by Ben */
/* And again by Steve */
if(!is_set || (sk_num(a) < 2))
if(!is_set || (sk_BLOCK_num(a) < 2))
{
for (i=0; i<sk_num(a); i++)
i2d(sk_value(a,i),&p);
for (i=0; i<sk_BLOCK_num(a); i++)
i2d(sk_BLOCK_value(a,i),&p);
*pp=p;
return(r);
......@@ -119,17 +120,17 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, i2d_of_void *i2d, int ex_tag,
pStart = p; /* Catch the beg of Setblobs*/
/* In this array we will store the SET blobs */
rgSetBlob = (MYBLOB *)OPENSSL_malloc(sk_num(a) * sizeof(MYBLOB));
rgSetBlob = OPENSSL_malloc(sk_BLOCK_num(a) * sizeof(MYBLOB));
if (rgSetBlob == NULL)
{
ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
return(0);
}
for (i=0; i<sk_num(a); i++)
for (i=0; i<sk_BLOCK_num(a); i++)
{
rgSetBlob[i].pbData = p; /* catch each set encode blob */
i2d(sk_value(a,i),&p);
i2d(sk_BLOCK_value(a,i),&p);
rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this
SetBlob
*/
......@@ -139,7 +140,7 @@ SetBlob
/* Now we have to sort the blobs. I am using a simple algo.
*Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
qsort( rgSetBlob, sk_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp);
if (!(pTempMem = OPENSSL_malloc(totSize)))
{
ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
......@@ -148,7 +149,7 @@ SetBlob
/* Copy to temp mem */
p = pTempMem;
for(i=0; i<sk_num(a); ++i)
for(i=0; i<sk_BLOCK_num(a); ++i)
{
memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData);
p += rgSetBlob[i].cbData;
......@@ -162,16 +163,17 @@ SetBlob
return(r);
}
STACK *d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
d2i_of_void *d2i, void (*free_func)(void *), int ex_tag,
int ex_class)
STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
long length, d2i_of_void *d2i,
void (*free_func)(BLOCK), int ex_tag,
int ex_class)
{
ASN1_const_CTX c;
STACK *ret=NULL;
STACK_OF(BLOCK) *ret=NULL;
if ((a == NULL) || ((*a) == NULL))
{
if ((ret=sk_new_null()) == NULL)
if ((ret=sk_BLOCK_new_null()) == NULL)
{
ASN1err(ASN1_F_D2I_ASN1_SET,ERR_R_MALLOC_FAILURE);
goto err;
......@@ -219,7 +221,7 @@ STACK *d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
asn1_add_error(*pp,(int)(c.q- *pp));
goto err;
}
if (!sk_push(ret,s)) goto err;
if (!sk_BLOCK_push(ret,s)) goto err;
}
if (a != NULL) (*a)=ret;
*pp=c.p;
......@@ -228,9 +230,9 @@ err:
if ((ret != NULL) && ((a == NULL) || (*a != ret)))
{
if (free_func != NULL)
sk_pop_free(ret,free_func);
sk_BLOCK_pop_free(ret,free_func);
else
sk_free(ret);
sk_BLOCK_free(ret);
}
return(NULL);
}
......
......@@ -94,7 +94,8 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] =
};
typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
static STACK *app_methods = NULL;
DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD);
static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL;
......@@ -121,7 +122,7 @@ int EVP_PKEY_asn1_get_count(void)
{
int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
if (app_methods)
num += sk_num(app_methods);
num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
return num;
}
......@@ -133,7 +134,7 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)
if (idx < num)
return standard_methods[idx];
idx -= num;
return (const EVP_PKEY_ASN1_METHOD *)sk_value(app_methods, idx);
return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
}
static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
......@@ -143,10 +144,9 @@ static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)
if (app_methods)
{
int idx;
idx = sk_find(app_methods, (char *)&tmp);
idx = sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp);
if (idx >= 0)
return (EVP_PKEY_ASN1_METHOD *)
sk_value(app_methods, idx);
return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
}
ret = (EVP_PKEY_ASN1_METHOD **) OBJ_bsearch((char *)&t,
(char *)standard_methods,
......@@ -234,13 +234,13 @@ int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth)
{
if (app_methods == NULL)
{
app_methods = sk_new((sk_cmp_fn_type *)ameth_cmp);
app_methods = sk_EVP_PKEY_ASN1_METHOD_new(ameth_cmp);
if (!app_methods)
return 0;
}
if (!sk_push(app_methods, (char *)ameth))
if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth))
return 0;
sk_sort(app_methods);
sk_EVP_PKEY_ASN1_METHOD_sort(app_methods);
return 1;
}
......
......@@ -879,11 +879,13 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
int i2d_ASN1_SET(STACK *a, unsigned char **pp,
i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
d2i_of_void *d2i, void (*free_func)(void *),
int ex_tag, int ex_class);
int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
i2d_of_void *i2d, int ex_tag, int ex_class,
int is_set);
STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
long length, d2i_of_void *d2i,
void (*free_func)(BLOCK), int ex_tag,
int ex_class);
#ifndef OPENSSL_NO_BIO
int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
......@@ -1035,9 +1037,9 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
unsigned char *data, int max_len);
STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
d2i_of_void *d2i, void (*free_func)(void *));
unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
STACK_OF(BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
d2i_of_void *d2i, void (*free_func)(BLOCK));
unsigned char *ASN1_seq_pack(STACK_OF(BLOCK) *safes, i2d_of_void *i2d,
unsigned char **buf, int *len );
void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
......
......@@ -66,10 +66,10 @@
/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
d2i_of_void *d2i,void (*free_func)(void *))
STACK_OF(BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
d2i_of_void *d2i, void (*free_func)(BLOCK))
{
STACK *sk;
STACK_OF(BLOCK) *sk;
const unsigned char *pbuf;
pbuf = buf;
if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func,
......@@ -82,7 +82,7 @@ STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
* OPENSSL_malloc'ed buffer
*/
unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
unsigned char *ASN1_seq_pack(STACK_OF(BLOCK) *safes, i2d_of_void *i2d,
unsigned char **buf, int *len)
{
int safelen;
......
......@@ -668,11 +668,12 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
else
{
/* We've got a valid STACK: free up any items present */
STACK *sktmp = (STACK *)*val;
STACK_OF(ASN1_VALUE) *sktmp
= (STACK_OF(ASN1_VALUE) *)*val;
ASN1_VALUE *vtmp;
while(sk_num(sktmp) > 0)
while(sk_ASN1_VALUE_num(sktmp) > 0)
{
vtmp = (ASN1_VALUE *)sk_pop(sktmp);
vtmp = sk_ASN1_VALUE_pop(sktmp);
ASN1_item_ex_free(&vtmp,
ASN1_ITEM_ptr(tt->item));
}
......@@ -713,7 +714,8 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
goto err;
}
len -= p - q;
if (!sk_push((STACK *)*val, (char *)skfield))
if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val,
skfield))
{
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I,
ERR_R_MALLOC_FAILURE);
......
......@@ -354,6 +354,8 @@ int asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
{
char *tname;
ASN1_VALUE *skitem;
STACK_OF(ASN1_VALUE) *stack;
/* SET OF, SEQUENCE OF */
if (fname)
{
......@@ -371,12 +373,13 @@ int asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent,
fname) <= 0)
return 0;
}
for(i = 0; i < sk_num((STACK *)*fld); i++)
stack = (STACK_OF(ASN1_VALUE) *)*fld;
for(i = 0; i < sk_ASN1_VALUE_num(stack); i++)
{
if ((i > 0) && (BIO_puts(out, "\n") <= 0))
return 0;
skitem = (ASN1_VALUE *)sk_value((STACK *)*fld, i);
skitem = sk_ASN1_VALUE_value(stack, i);
if (!asn1_item_print_ctx(out, &skitem, indent + 2,
ASN1_ITEM_ptr(tt->item), NULL, NULL, 1, pctx))
return 0;
......
......@@ -63,6 +63,9 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY);
static int x509_name_ex_d2i(ASN1_VALUE **val,
const unsigned char **in, long len,
const ASN1_ITEM *it,
......@@ -76,7 +79,8 @@ static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it);
static int x509_name_encode(X509_NAME *a);
static int x509_name_canon(X509_NAME *a);
static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in);
static int i2d_name_canon(STACK *intname, unsigned char **in);
static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname,
unsigned char **in);
static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval,
......@@ -165,27 +169,13 @@ static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
*pval = NULL;
}
/* Used with sk_pop_free() to free up the internal representation.
* NB: we only free the STACK and not its contents because it is
* already present in the X509_NAME structure.
*/
static void sk_internal_free(void *a)
{
sk_free(a);
}
static void canon_free(void *a)
{
sk_X509_NAME_ENTRY_pop_free(a, X509_NAME_ENTRY_free);
}
static int x509_name_ex_d2i(ASN1_VALUE **val,
const unsigned char **in, long len, const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
const unsigned char *p = *in, *q;
union { STACK *s; ASN1_VALUE *a; } intname = {NULL};
union { STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
ASN1_VALUE *a; } intname = {NULL};
union { X509_NAME *x; ASN1_VALUE *a; } nm = {NULL};
int i, j, ret;
STACK_OF(X509_NAME_ENTRY) *entries;
......@@ -206,8 +196,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
memcpy(nm.x->bytes->data, q, p - q);
/* Convert internal representation to X509_NAME structure */
for(i = 0; i < sk_num(intname.s); i++) {
entries = (STACK_OF(X509_NAME_ENTRY) *)sk_value(intname.s, i);
for(i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
for(j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
entry = sk_X509_NAME_ENTRY_value(entries, j);
entry->set = i;
......@@ -216,7 +206,7 @@ static int x509_name_ex_d2i(ASN1_VALUE **val,
}
sk_X509_NAME_ENTRY_free(entries);
}
sk_free(intname.s);
sk_STACK_OF_X509_NAME_ENTRY_free(intname.s);
ret = x509_name_canon(nm.x);
if (!ret)
goto err;
......@@ -249,22 +239,30 @@ static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, const ASN1_IT
return ret;
}
static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne)
{
sk_X509_NAME_ENTRY_free(ne);
}
static int x509_name_encode(X509_NAME *a)
{
union { STACK *s; ASN1_VALUE *a; } intname = {NULL};
union { STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
ASN1_VALUE *a; } intname = {NULL};
int len;
unsigned char *p;
STACK_OF(X509_NAME_ENTRY) *entries = NULL;
X509_NAME_ENTRY *entry;
int i, set = -1;
intname.s = sk_new_null();
intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null();
if(!intname.s) goto memerr;
for(i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
entry = sk_X509_NAME_ENTRY_value(a->entries, i);
if(entry->set != set) {
entries = sk_X509_NAME_ENTRY_new_null();
if(!entries) goto memerr;
if(!sk_push(intname.s, (char *)entries)) goto memerr;
if(!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s,
entries))
goto memerr;
set = entry->set;
}
if(!sk_X509_NAME_ENTRY_push(entries, entry)) goto memerr;
......@@ -275,11 +273,13 @@ static int x509_name_encode(X509_NAME *a)
p=(unsigned char *)a->bytes->data;
ASN1_item_ex_i2d(&intname.a,
&p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1);
sk_pop_free(intname.s, sk_internal_free);
sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
local_sk_X509_NAME_ENTRY_free);
a->modified = 0;
return len;
memerr:
sk_pop_free(intname.s, sk_internal_free);
memerr:
sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
local_sk_X509_NAME_ENTRY_free);
ASN1err(ASN1_F_X509_NAME_ENCODE, ERR_R_MALLOC_FAILURE);
return -1;
}
......@@ -311,10 +311,11 @@ static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval,
static int x509_name_canon(X509_NAME *a)
{
unsigned char *p;
STACK *intname = NULL;
STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname = NULL;
STACK_OF(X509_NAME_ENTRY) *entries = NULL;
X509_NAME_ENTRY *entry, *tmpentry = NULL;
int i, set = -1, ret = 0;
if (a->canon_enc)
{
OPENSSL_free(a->canon_enc);
......@@ -326,7 +327,7 @@ static int x509_name_canon(X509_NAME *a)
a->canon_enclen = 0;
return 1;
}
intname = sk_new_null();
intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
if(!intname)
goto err;
for(i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++)
......@@ -337,7 +338,7 @@ static int x509_name_canon(X509_NAME *a)
entries = sk_X509_NAME_ENTRY_new_null();
if(!entries)
goto err;
if(!sk_push(intname, (char *)entries))
if(!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries))
goto err;
set = entry->set;
}
......@@ -370,7 +371,8 @@ static int x509_name_canon(X509_NAME *a)
if (tmpentry)
X509_NAME_ENTRY_free(tmpentry);
if (intname)
sk_pop_free(intname, canon_free);
sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
local_sk_X509_NAME_ENTRY_free);
return ret;
}
......@@ -467,14 +469,17 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in)
}
static int i2d_name_canon(STACK *intname, unsigned char **in)
static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) *_intname,
unsigned char **in)
{
int i, len, ltmp;
ASN1_VALUE *v;
STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
len = 0;
for (i = 0; i < sk_num(intname); i++)
for (i = 0; i < sk_ASN1_VALUE_num(intname); i++)
{
v = (ASN1_VALUE *)sk_value(intname, i);
v = sk_ASN1_VALUE_value(intname, i);
ltmp = ASN1_item_ex_i2d(&v, in,
ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
if (ltmp < 0)
......
......@@ -71,12 +71,10 @@
static void value_free_hash_doall_arg(CONF_VALUE *a,
LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall_arg(CONF_VALUE *a,
LHASH_OF(CONF_VALUE) *conf);
static void value_free_stack_doall(CONF_VALUE *a);
static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_hash, CONF_VALUE,
LHASH_OF(CONF_VALUE))
static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_stack, CONF_VALUE,
LHASH_OF(CONF_VALUE))
static IMPLEMENT_LHASH_DOALL_FN(value_free_stack, CONF_VALUE)
/* Up until OpenSSL 0.9.5a, this was get_section */
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
......@@ -229,15 +227,14 @@ void _CONF_free_data(CONF *conf)
lh_CONF_VALUE_down_load(conf->data)=0; /* evil thing to make
* sure the 'OPENSSL_free()' works as
* expected */
lh_CONF_VALUE_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_hash),
lh_CONF_VALUE_doall_arg(conf->data,
LHASH_DOALL_ARG_FN(value_free_hash),
LHASH_OF(CONF_VALUE), conf->data);
/* We now have only 'section' entries in the hash table.
* Due to problems with */
lh_CONF_VALUE_doall_arg(conf->data,
LHASH_DOALL_ARG_FN(value_free_stack),
LHASH_OF(CONF_VALUE), conf->data);
lh_CONF_VALUE_doall(conf->data, LHASH_DOALL_FN(value_free_stack));
lh_CONF_VALUE_free(conf->data);
}
......@@ -247,24 +244,23 @@ static void value_free_hash_doall_arg(CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf)
lh_CONF_VALUE_delete(conf,a);
}
static void value_free_stack_doall_arg(CONF_VALUE *a,
LHASH_OF(CONF_VALUE) *conf)
static void value_free_stack_doall(CONF_VALUE *a)
{
CONF_VALUE *vv;
STACK *sk;
STACK_OF(CONF_VALUE) *sk;
int i;
if (a->name != NULL) return;
sk=(STACK *)a->value;
for (i=sk_num(sk)-1; i>=0; i--)
sk=(STACK_OF(CONF_VALUE) *)a->value;
for (i=sk_CONF_VALUE_num(sk)-1; i>=0; i--)
{
vv=(CONF_VALUE *)sk_value(sk,i);
vv=sk_CONF_VALUE_value(sk,i);
OPENSSL_free(vv->value);
OPENSSL_free(vv->name);
OPENSSL_free(vv);
}
if (sk != NULL) sk_free(sk);
if (sk != NULL) sk_CONF_VALUE_free(sk);
OPENSSL_free(a->section);
OPENSSL_free(a);
}
......@@ -272,16 +268,16 @@ static void value_free_stack_doall_arg(CONF_VALUE *a,
/* Up until OpenSSL 0.9.5a, this was new_section */
CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
{
STACK *sk=NULL;
STACK_OF(CONF_VALUE) *sk=NULL;
int ok=0,i;
CONF_VALUE *v=NULL,*vv;
if ((sk=sk_new_null()) == NULL)
if ((sk=sk_CONF_VALUE_new_null()) == NULL)
goto err;
if ((v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
if ((v=OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
goto err;
i=strlen(section)+1;
if ((v->section=(char *)OPENSSL_malloc(i)) == NULL)
if ((v->section=OPENSSL_malloc(i)) == NULL)
goto err;
memcpy(v->section,section,i);
......@@ -294,7 +290,7 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section)
err:
if (!ok)
{
if (sk != NULL) sk_free(sk);
if (sk != NULL) sk_CONF_VALUE_free(sk);
if (v != NULL) OPENSSL_free(v);
v=NULL;
}
......
......@@ -122,7 +122,6 @@ static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
#endif
DECLARE_STACK_OF(CRYPTO_dynlock)
IMPLEMENT_STACK_OF(CRYPTO_dynlock)
/* real #defines in crypto.h, keep these upto date */
static const char* const lock_names[CRYPTO_NUM_LOCKS] =
......@@ -173,7 +172,7 @@ static const char* const lock_names[CRYPTO_NUM_LOCKS] =
/* This is for applications to allocate new type names in the non-dynamic
array of lock names. These are numbered with positive numbers. */
static STACK *app_locks=NULL;
static STACK_OF(STRING) *app_locks=NULL;
/* For applications that want a more dynamic way of handling threads, the
following stack is used. These are externally numbered with negative
......@@ -207,7 +206,7 @@ int CRYPTO_get_new_lockid(char *name)
SSLeay_MSVC5_hack=(double)name[0]*(double)name[1];
#endif
if ((app_locks == NULL) && ((app_locks=sk_new_null()) == NULL))
if ((app_locks == NULL) && ((app_locks=sk_STRING_new_null()) == NULL))
{
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE);
return(0);
......@@ -217,7 +216,7 @@ int CRYPTO_get_new_lockid(char *name)
CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE);
return(0);
}
i=sk_push(app_locks,str);
i=sk_STRING_push(app_locks,str);
if (!i)
OPENSSL_free(str);
else
......@@ -587,10 +586,10 @@ const char *CRYPTO_get_lock_name(int type)
return("dynamic");
else if (type < CRYPTO_NUM_LOCKS)
return(lock_names[type]);
else if (type-CRYPTO_NUM_LOCKS > sk_num(app_locks))
else if (type-CRYPTO_NUM_LOCKS > sk_STRING_num(app_locks))
return("ERROR");
else
return(sk_value(app_locks,type-CRYPTO_NUM_LOCKS));
return(sk_STRING_value(app_locks,type-CRYPTO_NUM_LOCKS));
}
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
......
......@@ -282,9 +282,10 @@ typedef struct bio_st BIO_dummy;
struct crypto_ex_data_st
{
STACK *sk;
STACK_OF(void) *sk;
int dummy; /* gcc is screwing up this data structure :-( */
};
DECLARE_STACK_OF(void)
/* This stuff is basically class callback functions
* The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */
......
......@@ -140,14 +140,20 @@ dh_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dh_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_key.c
dh_lib.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os2.h
dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
dh_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dh_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_lib.c
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dh_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dh_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dh_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
dh_lib.o: ../cryptlib.h dh_lib.c
dh_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h
dh_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dh_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
......
......@@ -142,11 +142,16 @@ dsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
dsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
dsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
dsa_lib.o: ../cryptlib.h dsa_lib.c
dsa_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
......
......@@ -188,7 +188,7 @@ struct dso_st
* for use in the dso_bind handler. All in all, let each
* method control its own destiny. "Handles" and such go in
* a STACK. */
STACK *meth_data;
STACK_OF(void) *meth_data;
int references;
int flags;
/* For use by applications etc ... use this for your bits'n'pieces,
......
......@@ -183,7 +183,7 @@ static int dlfcn_load(DSO *dso)
ERR_add_error_data(4, "filename(", filename, "): ", dlerror());
goto err;
}
if(!sk_push(dso->meth_data, (char *)ptr))
if(!sk_void_push(dso->meth_data, (char *)ptr))
{
DSOerr(DSO_F_DLFCN_LOAD,DSO_R_STACK_ERROR);
goto err;
......@@ -208,15 +208,15 @@ static int dlfcn_unload(DSO *dso)
DSOerr(DSO_F_DLFCN_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
return(0);
}
if(sk_num(dso->meth_data) < 1)
if(sk_void_num(dso->meth_data) < 1)
return(1);
ptr = (void *)sk_pop(dso->meth_data);
ptr = sk_void_pop(dso->meth_data);
if(ptr == NULL)
{
DSOerr(DSO_F_DLFCN_UNLOAD,DSO_R_NULL_HANDLE);
/* Should push the value back onto the stack in
* case of a retry. */
sk_push(dso->meth_data, (char *)ptr);
sk_void_push(dso->meth_data, ptr);
return(0);
}
/* For now I'm not aware of any errors associated with dlclose() */
......@@ -233,12 +233,12 @@ static void *dlfcn_bind_var(DSO *dso, const char *symname)
DSOerr(DSO_F_DLFCN_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
if(sk_num(dso->meth_data) < 1)
if(sk_void_num(dso->meth_data) < 1)
{
DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_STACK_ERROR);
return(NULL);
}
ptr = (void *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
ptr = sk_void_value(dso->meth_data, sk_void_num(dso->meth_data) - 1);
if(ptr == NULL)
{
DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_NULL_HANDLE);
......@@ -264,12 +264,12 @@ static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
DSOerr(DSO_F_DLFCN_BIND_FUNC,ERR_R_PASSED_NULL_PARAMETER);
return(NULL);
}
if(sk_num(dso->meth_data) < 1)
if(sk_void_num(dso->meth_data) < 1)
{
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_STACK_ERROR);
return(NULL);
}
ptr = (void *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
ptr = sk_void_value(dso->meth_data, sk_void_num(dso->meth_data) - 1);
if(ptr == NULL)
{
DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE);
......
......@@ -107,7 +107,7 @@ DSO *DSO_new_method(DSO_METHOD *meth)
return(NULL);
}
memset(ret, 0, sizeof(DSO));
ret->meth_data = sk_new_null();
ret->meth_data = sk_void_new_null();
if(ret->meth_data == NULL)
{
/* sk_new doesn't generate any errors so we do */
......@@ -163,7 +163,7 @@ int DSO_free(DSO *dso)
return(0);
}
sk_free(dso->meth_data);
sk_void_free(dso->meth_data);
if(dso->filename != NULL)
OPENSSL_free(dso->filename);
if(dso->loaded_filename != NULL)
......
......@@ -84,20 +84,30 @@ ech_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ech_err.o: ech_err.c
ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ech_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ech_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ech_key.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h
ech_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ech_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ech_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ech_key.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ech_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ech_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ech_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ech_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ech_key.o: ../../include/openssl/symhacks.h ech_key.c ech_locl.h
ech_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ech_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ech_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ech_key.o: ../../include/openssl/x509_vfy.h ech_key.c ech_locl.h
ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ech_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ech_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ech_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ech_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ech_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ech_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ech_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ech_lib.o: ../../include/openssl/symhacks.h ech_lib.c ech_locl.h
ech_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ech_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ech_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ech_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
ech_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ech_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ech_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ech_lib.o: ech_lib.c ech_locl.h
ech_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
ech_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ech_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
......
......@@ -92,14 +92,18 @@ ecs_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecs_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_err.o: ecs_err.c
ecs_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecs_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ecs_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecs_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecs_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecs_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_lib.o: ecs_lib.c ecs_locl.h
ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ecs_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_lib.o: ../../include/openssl/x509_vfy.h ecs_lib.c ecs_locl.h
ecs_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecs_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
......@@ -110,16 +114,26 @@ ecs_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_ossl.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_ossl.c
ecs_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h
ecs_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_sign.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_sign.c
ecs_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_sign.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_sign.c
ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_vrf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_vrf.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h
ecs_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_vrf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_vrf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_vrf.c
ecs_vrf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_vrf.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_vrf.c
此差异已折叠。
......@@ -146,14 +146,14 @@ struct st_dynamic_data_ctx
* 'dirs' for loading. Default is to use 'dirs' as a fallback. */
int dir_load;
/* A stack of directories from which ENGINEs could be loaded */
STACK *dirs;
STACK_OF(STRING) *dirs;
};
/* This is the "ex_data" index we obtain and reserve for use with our context
* structure. */
static int dynamic_ex_data_idx = -1;
static void int_free_str(void *s) { OPENSSL_free(s); }
static void int_free_str(char *s) { OPENSSL_free(s); }
/* Because our ex_data element may or may not get allocated depending on whether
* a "first-use" occurs before the ENGINE is freed, we have a memory leak
* problem to solve. We can't declare a "new" handler for the ex_data as we
......@@ -174,7 +174,7 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr,
if(ctx->engine_id)
OPENSSL_free((void*)ctx->engine_id);
if(ctx->dirs)
sk_pop_free(ctx->dirs, int_free_str);
sk_STRING_pop_free(ctx->dirs, int_free_str);
OPENSSL_free(ctx);
}
}
......@@ -203,7 +203,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
c->DYNAMIC_F1 = "v_check";
c->DYNAMIC_F2 = "bind_engine";
c->dir_load = 1;
c->dirs = sk_new_null();
c->dirs = sk_STRING_new_null();
if(!c->dirs)
{
ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
......@@ -393,7 +393,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
ERR_R_MALLOC_FAILURE);
return 0;
}
sk_insert(ctx->dirs, tmp_str, -1);
sk_STRING_insert(ctx->dirs, tmp_str, -1);
}
return 1;
default:
......@@ -411,11 +411,11 @@ static int int_load(dynamic_data_ctx *ctx)
ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL)
return 1;
/* If we're not allowed to use 'dirs' or we have none, fail */
if(!ctx->dir_load || ((num = sk_num(ctx->dirs)) < 1))
if(!ctx->dir_load || (num = sk_STRING_num(ctx->dirs)) < 1)
return 0;
for(loop = 0; loop < num; loop++)
{
const char *s = sk_value(ctx->dirs, loop);
const char *s = sk_STRING_value(ctx->dirs, loop);
char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);
if(!merge)
return 0;
......
......@@ -88,7 +88,6 @@
#include <openssl/ecdsa.h>
#endif
#include <openssl/rand.h>
#include <openssl/store.h>
#include <openssl/ui.h>
#include <openssl/err.h>
#endif
......@@ -96,6 +95,8 @@
#include <openssl/ossl_typ.h>
#include <openssl/symhacks.h>
#include <openssl/x509.h>
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -135,13 +135,17 @@ bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c
c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
c_all.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h c_all.c
c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
c_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
c_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
c_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
c_all.o: ../cryptlib.h c_all.c
c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
......@@ -170,13 +174,17 @@ c_alld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
c_alld.o: ../cryptlib.h c_alld.c
digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
digest.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
digest.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
digest.o: ../../include/openssl/symhacks.h ../cryptlib.h digest.c
digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
digest.o: ../cryptlib.h digest.c
e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
......@@ -321,13 +329,17 @@ evp_acnf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_acnf.c
evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h
evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_enc.o: ../../include/openssl/engine.h ../../include/openssl/err.h
evp_enc.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
evp_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
evp_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_enc.c evp_locl.h
evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
......@@ -704,11 +716,15 @@ pmeth_gn.o: pmeth_gn.c
pmeth_lib.o: ../../e_os.h ../../include/openssl/asn1.h
pmeth_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pmeth_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pmeth_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
pmeth_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pmeth_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pmeth_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pmeth_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
pmeth_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pmeth_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pmeth_lib.o: ../../include/openssl/objects.h
pmeth_lib.o: ../../include/openssl/opensslconf.h
pmeth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pmeth_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
pmeth_lib.o: ../../include/openssl/symhacks.h ../asn1/asn1_locl.h ../cryptlib.h
pmeth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pmeth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pmeth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pmeth_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
pmeth_lib.o: evp_locl.h pmeth_lib.c
......@@ -64,7 +64,8 @@
/* Password based encryption (PBE) functions */
static STACK *pbe_algs;
DECLARE_STACK_OF(EVP_PBE_CTL);
static STACK_OF(EVP_PBE_CTL) *pbe_algs;
/* Setup a cipher context from a PBE algorithm */
......@@ -147,7 +148,7 @@ int main(int argc, char **argv)
int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de)
ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de)
{
const EVP_CIPHER *cipher;
const EVP_MD *md;
......@@ -199,25 +200,23 @@ static int pbe_cmp2(const void *a, const void *b)
return pbe1->pbe_nid - pbe2->pbe_nid;
}
static int pbe_cmp(const char * const *a, const char * const *b)
static int pbe_cmp(const EVP_PBE_CTL * const *a, const EVP_PBE_CTL * const *b)
{
const EVP_PBE_CTL * const *pbe1 = (const EVP_PBE_CTL * const *) a,
* const *pbe2 = (const EVP_PBE_CTL * const *)b;
int ret = (*pbe1)->pbe_type - (*pbe2)->pbe_type;
int ret = (*a)->pbe_type - (*b)->pbe_type;
if (ret)
return ret;
else
return (*pbe1)->pbe_nid - (*pbe2)->pbe_nid;
return (*a)->pbe_nid - (*b)->pbe_nid;
}
/* Add a PBE algorithm */
int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid,
EVP_PBE_KEYGEN *keygen)
EVP_PBE_KEYGEN *keygen)
{
EVP_PBE_CTL *pbe_tmp;
if (!pbe_algs)
pbe_algs = sk_new(pbe_cmp);
pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL))))
{
EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE,ERR_R_MALLOC_FAILURE);
......@@ -230,12 +229,12 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid,
pbe_tmp->keygen = keygen;
sk_push (pbe_algs, (char *)pbe_tmp);
sk_EVP_PBE_CTL_push (pbe_algs, pbe_tmp);
return 1;
}
int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
EVP_PBE_KEYGEN *keygen)
EVP_PBE_KEYGEN *keygen)
{
int cipher_nid, md_nid;
if (cipher)
......@@ -252,7 +251,7 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
}
int EVP_PBE_find(int type, int pbe_nid,
int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)
int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)
{
EVP_PBE_CTL *pbetmp = NULL, pbelu;
int i;
......@@ -264,9 +263,9 @@ int EVP_PBE_find(int type, int pbe_nid,
if (pbe_algs)
{
i = sk_find(pbe_algs, (char *)&pbelu);
i = sk_EVP_PBE_CTL_find(pbe_algs, &pbelu);
if (i != -1)
pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
pbetmp = sk_EVP_PBE_CTL_value (pbe_algs, i);
}
if (pbetmp == NULL)
{
......@@ -286,11 +285,14 @@ int EVP_PBE_find(int type, int pbe_nid,
*pkeygen = pbetmp->keygen;
return 1;
}
static void free_evp_pbe_ctl(EVP_PBE_CTL *pbe)
{
OPENSSL_freeFunc(pbe);
}
void EVP_PBE_cleanup(void)
{
sk_pop_free(pbe_algs, OPENSSL_freeFunc);
sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
pbe_algs = NULL;
}
......@@ -68,7 +68,9 @@
#include "evp_locl.h"
typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
STACK *app_pkey_methods = NULL;
DECLARE_STACK_OF(EVP_PKEY_METHOD);
STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth;
extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth;
......@@ -95,10 +97,9 @@ const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type)
if (app_pkey_methods)
{
int idx;
idx = sk_find(app_pkey_methods, (char *)&tmp);
idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);
if (idx >= 0)
return (EVP_PKEY_METHOD *)
sk_value(app_pkey_methods, idx);
return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
}
ret = (EVP_PKEY_METHOD **) OBJ_bsearch((char *)&t,
(char *)standard_methods,
......@@ -279,13 +280,13 @@ int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth)
{
if (app_pkey_methods == NULL)
{
app_pkey_methods = sk_new((sk_cmp_fn_type *)pmeth_cmp);
app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp);
if (!app_pkey_methods)
return 0;
}
if (!sk_push(app_pkey_methods, (char *)pmeth))
if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth))
return 0;
sk_sort(app_pkey_methods);
sk_EVP_PKEY_METHOD_sort(app_pkey_methods);
return 1;
}
......
......@@ -456,7 +456,7 @@ static int int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
return 0;
CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA);
mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
j = sk_num(from->sk);
j = sk_void_num(from->sk);
if(j < mx)
mx = j;
if(mx > 0)
......@@ -527,7 +527,7 @@ skip:
OPENSSL_free(storage);
if(ad->sk)
{
sk_free(ad->sk);
sk_void_free(ad->sk);
ad->sk=NULL;
}
}
......@@ -600,24 +600,24 @@ int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val)
if (ad->sk == NULL)
{
if ((ad->sk=sk_new_null()) == NULL)
if ((ad->sk=sk_void_new_null()) == NULL)
{
CRYPTOerr(CRYPTO_F_CRYPTO_SET_EX_DATA,ERR_R_MALLOC_FAILURE);
return(0);
}
}
i=sk_num(ad->sk);
i=sk_void_num(ad->sk);
while (i <= idx)
{
if (!sk_push(ad->sk,NULL))
if (!sk_void_push(ad->sk,NULL))
{
CRYPTOerr(CRYPTO_F_CRYPTO_SET_EX_DATA,ERR_R_MALLOC_FAILURE);
return(0);
}
i++;
}
sk_set(ad->sk,idx,val);
sk_void_set(ad->sk,idx,val);
return(1);
}
......@@ -627,10 +627,10 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
{
if (ad->sk == NULL)
return(0);
else if (idx >= sk_num(ad->sk))
else if (idx >= sk_void_num(ad->sk))
return(0);
else
return(sk_value(ad->sk,idx));
return(sk_void_value(ad->sk,idx));
}
IMPLEMENT_STACK_OF(CRYPTO_EX_DATA_FUNCS)
......@@ -230,24 +230,7 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out);
lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)
#define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))
/* Strings are special: normally an lhash entry will point to a single
* (somewhat) mutable object. In the case of strings:
*
* a) Instead of a single char, there is an array of chars, NUL-terminated.
* b) The string may have be immutable.
*
* So, they need their own declarations. Especially important for
* type-checking tools, such as Deputy.
*
* In practice, however, it appears to be hard to have a const
* string. For now, I'm settling for dealing with the fact it is a
* string at all.
*/
typedef char *STRING;
DECLARE_LHASH_OF(STRING);
typedef const char *CSTRING;
DECLARE_LHASH_OF(CSTRING);
#ifdef __cplusplus
......
......@@ -59,19 +59,20 @@
#include <openssl/objects.h>
#include "obj_xref.h"
STACK *sig_app, *sigx_app;
DECLARE_STACK_OF(nid_triple);
STACK_OF(nid_triple) *sig_app, *sigx_app;
static int cmp_sig(const nid_triple *a, const nid_triple *b)
{
return **a - **b;
}
static int cmp_sig_sk(const nid_triple **a, const nid_triple **b)
static int cmp_sig_sk(const nid_triple * const *a, const nid_triple * const *b)
{
return ***a - ***b;
}
static int cmp_sigx(const nid_triple **a, const nid_triple **b)
static int cmp_sigx(const nid_triple * const *a, const nid_triple * const *b)
{
int ret;
ret = (**a)[1] - (**b)[1];
......@@ -88,9 +89,9 @@ int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid)
if (sig_app)
{
int idx = sk_find(sig_app, (char *)&tmp);
int idx = sk_nid_triple_find(sig_app, &tmp);
if (idx >= 0)
rv = (nid_triple *)sk_value(sig_app, idx);
rv = sk_nid_triple_value(sig_app, idx);
}
#ifndef OBJ_XREF_TEST2
......@@ -118,10 +119,10 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid)
if (sigx_app)
{
int idx = sk_find(sigx_app, (char *)&tmp);
int idx = sk_nid_triple_find(sigx_app, &tmp);
if (idx >= 0)
{
t = (nid_triple *)sk_value(sigx_app, idx);
t = sk_nid_triple_value(sigx_app, idx);
rv = &t;
}
}
......@@ -142,17 +143,15 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid)
return 1;
}
typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
{
nid_triple *ntr;
if (!sig_app)
sig_app = sk_new((sk_cmp_fn_type *)cmp_sig_sk);
sig_app = sk_nid_triple_new(cmp_sig_sk);
if (!sig_app)
return 0;
if (!sigx_app)
sigx_app = sk_new((sk_cmp_fn_type *)cmp_sigx);
sigx_app = sk_nid_triple_new(cmp_sigx);
if (!sigx_app)
return 0;
ntr = OPENSSL_malloc(sizeof(int) * 3);
......@@ -162,24 +161,23 @@ int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
(*ntr)[1] = dig_id;
(*ntr)[2] = pkey_id;
if (!sk_push(sig_app, (char *)ntr))
if (!sk_nid_triple_push(sig_app, ntr))
{
OPENSSL_free(ntr);
return 0;
}
if (!sk_push(sigx_app, (char *)ntr))
if (!sk_nid_triple_push(sigx_app, ntr))
return 0;
sk_sort(sig_app);
sk_sort(sigx_app);
sk_nid_triple_sort(sig_app);
sk_nid_triple_sort(sigx_app);
return 1;
}
static void sid_free(void *x)
static void sid_free(nid_triple *tt)
{
nid_triple *tt = (nid_triple *)x;
OPENSSL_free(tt);
}
......@@ -187,12 +185,12 @@ void OBJ_sigid_free(void)
{
if (sig_app)
{
sk_pop_free(sig_app, sid_free);
sk_nid_triple_pop_free(sig_app, sid_free);
sig_app = NULL;
}
if (sigx_app)
{
sk_free(sigx_app);
sk_nid_triple_free(sigx_app);
sigx_app = NULL;
}
}
......
......@@ -183,11 +183,8 @@ typedef struct pem_ctx_st
int num_recipient;
PEM_USER **recipient;
#ifndef OPENSSL_NO_STACK
STACK *x509_chain; /* certificate chain */
#else
char *x509_chain; /* certificate chain */
#endif
/* XXX(ben): don#t think this is used!
STACK *x509_chain; / * certificate chain */
EVP_MD *md; /* signature type */
int md_enc; /* is the md encrypted or not? */
......
......@@ -97,14 +97,19 @@ rand_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rand_err.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
rand_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rand_err.o: rand_err.c
rand_lib.o: ../../e_os.h ../../include/openssl/bio.h
rand_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rand_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
rand_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
rand_lib.o: ../../include/openssl/opensslconf.h
rand_lib.o: ../../e_os.h ../../include/openssl/asn1.h
rand_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
rand_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
rand_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
rand_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
rand_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
rand_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rand_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rand_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rand_lib.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
rand_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
rand_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rand_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rand_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rand_lib.o: ../cryptlib.h rand_lib.c
rand_nw.o: ../../e_os.h ../../include/openssl/asn1.h
rand_nw.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
......
......@@ -151,12 +151,17 @@ rsa_gen.o: ../cryptlib.h rsa_gen.c
rsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h
rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
rsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
rsa_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
rsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_lib.o: ../cryptlib.h rsa_lib.c
rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h
rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
......
此差异已折叠。
......@@ -77,10 +77,11 @@ const char STACK_version[]="Stack" OPENSSL_VERSION_PTEXT;
#include <errno.h>
int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,const char * const *)))
(const char * const *, const char * const *)
int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void * const *,
const void * const *)))
(const void * const *, const void * const *)
{
int (*old)(const char * const *,const char * const *)=sk->comp;
int (*old)(const void * const *,const void * const *)=sk->comp;
if (sk->comp != c)
sk->sorted=0;
......@@ -89,9 +90,9 @@ int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,const char * cons
return old;
}
STACK *sk_dup(STACK *sk)
_STACK *sk_dup(_STACK *sk)
{
STACK *ret;
_STACK *ret;
char **s;
if ((ret=sk_new(sk->comp)) == NULL) goto err;
......@@ -112,19 +113,19 @@ err:
return(NULL);
}
STACK *sk_new_null(void)
_STACK *sk_new_null(void)
{
return sk_new((int (*)(const char * const *, const char * const *))0);
return sk_new((int (*)(const void * const *, const void * const *))0);
}
STACK *sk_new(int (*c)(const char * const *, const char * const *))
_STACK *sk_new(int (*c)(const void * const *, const void * const *))
{
STACK *ret;
_STACK *ret;
int i;
if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
if ((ret=OPENSSL_malloc(sizeof(_STACK))) == NULL)
goto err;
if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
if ((ret->data=OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
goto err;
for (i=0; i<MIN_NODES; i++)
ret->data[i]=NULL;
......@@ -139,14 +140,14 @@ err:
return(NULL);
}
int sk_insert(STACK *st, char *data, int loc)
int sk_insert(_STACK *st, void *data, int loc)
{
char **s;
if(st == NULL) return 0;
if (st->num_alloc <= st->num+1)
{
s=(char **)OPENSSL_realloc((char *)st->data,
s=OPENSSL_realloc((char *)st->data,
(unsigned int)sizeof(char *)*st->num_alloc*2);
if (s == NULL)
return(0);
......@@ -160,14 +161,14 @@ int sk_insert(STACK *st, char *data, int loc)
int i;
char **f,**t;
f=(char **)st->data;
t=(char **)&(st->data[1]);
f=st->data;
t=&(st->data[1]);
for (i=st->num; i>=loc; i--)
t[i]=f[i];
#ifdef undef /* no memmove on sunos :-( */
memmove( (char *)&(st->data[loc+1]),
(char *)&(st->data[loc]),
memmove(&(st->data[loc+1]),
&(st->data[loc]),
sizeof(char *)*(st->num-loc));
#endif
st->data[loc]=data;
......@@ -177,7 +178,7 @@ int sk_insert(STACK *st, char *data, int loc)
return(st->num);
}
char *sk_delete_ptr(STACK *st, char *p)
void *sk_delete_ptr(_STACK *st, void *p)
{
int i;
......@@ -187,7 +188,7 @@ char *sk_delete_ptr(STACK *st, char *p)
return(NULL);
}
char *sk_delete(STACK *st, int loc)
void *sk_delete(_STACK *st, int loc)
{
char *ret;
int i,j;
......@@ -210,7 +211,7 @@ char *sk_delete(STACK *st, int loc)
return(ret);
}
static int internal_find(STACK *st, char *data, int ret_val_options)
static int internal_find(_STACK *st, void *data, int ret_val_options)
{
char **r;
int i;
......@@ -239,40 +240,40 @@ static int internal_find(STACK *st, char *data, int ret_val_options)
return((int)(r-st->data));
}
int sk_find(STACK *st, char *data)
int sk_find(_STACK *st, void *data)
{
return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
}
int sk_find_ex(STACK *st, char *data)
int sk_find_ex(_STACK *st, void *data)
{
return internal_find(st, data, OBJ_BSEARCH_VALUE_ON_NOMATCH);
}
int sk_push(STACK *st, char *data)
int sk_push(_STACK *st, void *data)
{
return(sk_insert(st,data,st->num));
}
int sk_unshift(STACK *st, char *data)
int sk_unshift(_STACK *st, void *data)
{
return(sk_insert(st,data,0));
}
char *sk_shift(STACK *st)
void *sk_shift(_STACK *st)
{
if (st == NULL) return(NULL);
if (st->num <= 0) return(NULL);
return(sk_delete(st,0));
}
char *sk_pop(STACK *st)
void *sk_pop(_STACK *st)
{
if (st == NULL) return(NULL);
if (st->num <= 0) return(NULL);
return(sk_delete(st,st->num-1));
}
void sk_zero(STACK *st)
void sk_zero(_STACK *st)
{
if (st == NULL) return;
if (st->num <= 0) return;
......@@ -280,7 +281,7 @@ void sk_zero(STACK *st)
st->num=0;
}
void sk_pop_free(STACK *st, void (*func)(void *))
void sk_pop_free(_STACK *st, void (*func)(void *))
{
int i;
......@@ -291,32 +292,32 @@ void sk_pop_free(STACK *st, void (*func)(void *))
sk_free(st);
}
void sk_free(STACK *st)
void sk_free(_STACK *st)
{
if (st == NULL) return;
if (st->data != NULL) OPENSSL_free(st->data);
OPENSSL_free(st);
}
int sk_num(const STACK *st)
int sk_num(const _STACK *st)
{
if(st == NULL) return -1;
return st->num;
}
char *sk_value(const STACK *st, int i)
void *sk_value(const _STACK *st, int i)
{
if(!st || (i < 0) || (i >= st->num)) return NULL;
return st->data[i];
}
char *sk_set(STACK *st, int i, char *value)
void *sk_set(_STACK *st, int i, void *value)
{
if(!st || (i < 0) || (i >= st->num)) return NULL;
return (st->data[i] = value);
}
void sk_sort(STACK *st)
void sk_sort(_STACK *st)
{
if (st && !st->sorted)
{
......@@ -333,7 +334,7 @@ void sk_sort(STACK *st)
}
}
int sk_is_sorted(const STACK *st)
int sk_is_sorted(const _STACK *st)
{
if (!st)
return 1;
......
......@@ -70,37 +70,37 @@ typedef struct stack_st
int sorted;
int num_alloc;
int (*comp)(const char * const *, const char * const *);
} STACK;
int (*comp)(const void * const *, const void * const *);
} _STACK; /* Use STACK_OF(...) instead */
#define M_sk_num(sk) ((sk) ? (sk)->num:-1)
#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
int sk_num(const STACK *);
char *sk_value(const STACK *, int);
int sk_num(const _STACK *);
void *sk_value(const _STACK *, int);
char *sk_set(STACK *, int, char *);
void *sk_set(_STACK *, int, void *);
STACK *sk_new(int (*cmp)(const char * const *, const char * const *));
STACK *sk_new_null(void);
void sk_free(STACK *);
void sk_pop_free(STACK *st, void (*func)(void *));
int sk_insert(STACK *sk,char *data,int where);
char *sk_delete(STACK *st,int loc);
char *sk_delete_ptr(STACK *st, char *p);
int sk_find(STACK *st,char *data);
int sk_find_ex(STACK *st,char *data);
int sk_push(STACK *st,char *data);
int sk_unshift(STACK *st,char *data);
char *sk_shift(STACK *st);
char *sk_pop(STACK *st);
void sk_zero(STACK *st);
int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,
const char * const *)))
(const char * const *, const char * const *);
STACK *sk_dup(STACK *st);
void sk_sort(STACK *st);
int sk_is_sorted(const STACK *st);
_STACK *sk_new(int (*cmp)(const void * const *, const void * const *));
_STACK *sk_new_null(void);
void sk_free(_STACK *);
void sk_pop_free(_STACK *st, void (*func)(void *));
int sk_insert(_STACK *sk, void *data, int where);
void *sk_delete(_STACK *st, int loc);
void *sk_delete_ptr(_STACK *st, void *p);
int sk_find(_STACK *st, void *data);
int sk_find_ex(_STACK *st, void *data);
int sk_push(_STACK *st, void *data);
int sk_unshift(_STACK *st, void *data);
void *sk_shift(_STACK *st);
void *sk_pop(_STACK *st);
void sk_zero(_STACK *st);
int (*sk_set_cmp_func(_STACK *sk, int (*c)(const void * const *,
const void * const *)))
(const void * const *, const void * const *);
_STACK *sk_dup(_STACK *st);
void sk_sort(_STACK *st);
int sk_is_sorted(const _STACK *st);
#ifdef __cplusplus
}
......
......@@ -408,7 +408,8 @@ int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
/* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values
in each contained attribute. */
int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a,
const STORE_ATTR_INFO * const *b);
/* Check if the set of attributes in a is within the range of attributes
set in b. */
int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
......
......@@ -1670,7 +1670,7 @@ int STORE_parse_attrs_endp(void *handle)
}
static int attr_info_compare_compute_range(
unsigned char *abits, unsigned char *bbits,
const unsigned char *abits, const unsigned char *bbits,
unsigned int *alowp, unsigned int *ahighp,
unsigned int *blowp, unsigned int *bhighp)
{
......@@ -1739,13 +1739,15 @@ static int attr_info_compare_compute_range(
return res;
}
int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
int STORE_ATTR_INFO_compare(const STORE_ATTR_INFO * const *a,
const STORE_ATTR_INFO * const *b)
{
if (a == b) return 0;
if (!a) return -1;
if (!b) return 1;
return attr_info_compare_compute_range(a->set, b->set, 0, 0, 0, 0);
return attr_info_compare_compute_range((*a)->set, (*b)->set, 0, 0, 0, 0);
}
int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
{
unsigned int alow, ahigh, blow, bhigh;
......@@ -1759,6 +1761,7 @@ int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
return 1;
return 0;
}
int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
{
unsigned char *abits, *bbits;
......@@ -1776,6 +1779,7 @@ int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
}
return 1;
}
int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b)
{
STORE_ATTR_TYPES i;
......
......@@ -76,30 +76,35 @@
attribute type code).
*/
struct mem_object_data_st
typedef struct mem_object_data_st
{
STORE_OBJECT *object;
STORE_ATTR_INFO *attr_info;
int references;
};
} MEM_OBJECT_DATA;
DECLARE_STACK_OF(MEM_OBJECT_DATA);
struct mem_data_st
{
STACK *data; /* A stack of mem_object_data_st,
sorted with STORE_ATTR_INFO_compare(). */
STACK_OF(MEM_OBJECT_DATA) *data; /* sorted with
* STORE_ATTR_INFO_compare(). */
unsigned int compute_components : 1; /* Currently unused, but can
be used to add attributes
from parts of the data. */
};
DECLARE_STACK_OF(STORE_ATTR_INFO);
struct mem_ctx_st
{
int type; /* The type we're searching for */
STACK *search_attributes; /* Sets of attributes to search for.
Each element is a STORE_ATTR_INFO. */
int search_index; /* which of the search attributes we found a match
for, -1 when we still haven't found any */
int index; /* -1 as long as we're searching for the first */
STACK_OF(STORE_ATTR_INFO) *search_attributes; /* Sets of
attributes to search for. Each
element is a STORE_ATTR_INFO. */
int search_index; /* which of the search attributes we
found a match for, -1 when we still
haven't found any */
int index; /* -1 as long as we're searching for
the first */
};
static int mem_init(STORE *s);
......@@ -240,7 +245,7 @@ static void *mem_list_start(STORE *s, STORE_OBJECT_TYPES type,
if (context->search_attributes == NULL)
{
context->search_attributes =
sk_new((int (*)(const char * const *, const char * const *))STORE_ATTR_INFO_compare);
sk_STORE_ATTR_INFO_new(STORE_ATTR_INFO_compare);
if (!context->search_attributes)
{
STOREerr(STORE_F_MEM_LIST_START,
......@@ -248,7 +253,7 @@ static void *mem_list_start(STORE *s, STORE_OBJECT_TYPES type,
goto err;
}
}
sk_push(context->search_attributes,(char *)attrs);
sk_STORE_ATTR_INFO_push(context->search_attributes,attrs);
}
if (!STORE_parse_attrs_endp(attribute_context))
goto err;
......@@ -284,11 +289,14 @@ static STORE_OBJECT *mem_list_next(STORE *s, void *handle)
if (context->search_index == -1)
{
for (i = 0; i < sk_num(context->search_attributes); i++)
for (i = 0;
i < sk_STORE_ATTR_INFO_num(context->search_attributes);
i++)
{
key.attr_info =
(STORE_ATTR_INFO *)sk_value(context->search_attributes, i);
srch = sk_find_ex(store->data, (char *)&key);
key.attr_info
= sk_STORE_ATTR_INFO_value(context->search_attributes,
i);
srch = sk_MEM_OBJECT_DATA_find_ex(store->data, &key);
if (srch >= 0)
{
......@@ -301,21 +309,20 @@ static STORE_OBJECT *mem_list_next(STORE *s, void *handle)
return NULL;
key.attr_info =
(STORE_ATTR_INFO *)sk_value(context->search_attributes,
context->search_index);
sk_STORE_ATTR_INFO_value(context->search_attributes,
context->search_index);
for(srch = context->search_index;
srch < sk_num(store->data)
srch < sk_MEM_OBJECT_DATA_num(store->data)
&& STORE_ATTR_INFO_in_range(key.attr_info,
(STORE_ATTR_INFO *)sk_value(store->data, srch))
sk_MEM_OBJECT_DATA_value(store->data, srch))
&& !(cres = STORE_ATTR_INFO_in_ex(key.attr_info,
(STORE_ATTR_INFO *)sk_value(store->data, srch)));
sk_MEM_OBJECT_DATA_value(store->data, srch)));
srch++)
;
context->search_index = srch;
if (cres)
return ((struct mem_object_data_st *)sk_value(store->data,
srch))->object;
return (sk_MEM_OBJECT_DATA_value(store->data, srch))->object;
return NULL;
}
static int mem_list_end(STORE *s, void *handle)
......@@ -328,7 +335,7 @@ static int mem_list_end(STORE *s, void *handle)
return 0;
}
if (context && context->search_attributes)
sk_free(context->search_attributes);
sk_STORE_ATTR_INFO_free(context->search_attributes);
if (context) OPENSSL_free(context);
return 1;
}
......@@ -337,7 +344,8 @@ static int mem_list_endp(STORE *s, void *handle)
struct mem_ctx_st *context = (struct mem_ctx_st *)handle;
if (!context
|| context->search_index == sk_num(context->search_attributes))
|| context->search_index
== sk_STORE_ATTR_INFO_num(context->search_attributes))
return 1;
return 0;
}
......
......@@ -77,18 +77,19 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
int i,add,n;
int size=BUFSIZE;
int offset=0;
char *p,**pp,*f;
char *p,*f;
STRING *pp;
BUF_MEM *buf=NULL;
if ((buf=BUF_MEM_new()) == NULL) goto err;
if (!BUF_MEM_grow(buf,size)) goto err;
if ((ret=(TXT_DB *)OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
if ((ret=OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
goto err;
ret->num_fields=num;
ret->index=NULL;
ret->qual=NULL;
if ((ret->data=sk_new_null()) == NULL)
if ((ret->data=sk_PSTRING_new_null()) == NULL)
goto err;
if ((ret->index=OPENSSL_malloc(sizeof(*ret->index)*num)) == NULL)
goto err;
......@@ -122,7 +123,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
else
{
buf->data[offset-1]='\0'; /* blat the '\n' */
if (!(p=(char *)OPENSSL_malloc(add+offset))) goto err;
if (!(p=OPENSSL_malloc(add+offset))) goto err;
offset=0;
}
pp=(char **)p;
......@@ -155,16 +156,16 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
*(p++)='\0';
if ((n != num) || (*f != '\0'))
{
#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporaty fix :-( */
#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */
fprintf(stderr,"wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",ln,num,n,f);
#endif
er=2;
goto err;
}
pp[n]=p;
if (!sk_push(ret->data,(char *)pp))
if (!sk_PSTRING_push(ret->data,pp))
{
#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporaty fix :-( */
#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) /* temporary fix :-( */
fprintf(stderr,"failure in sk_push\n");
#endif
er=2;
......@@ -181,7 +182,7 @@ err:
#endif
if (ret != NULL)
{
if (ret->data != NULL) sk_free(ret->data);
if (ret->data != NULL) sk_PSTRING_free(ret->data);
if (ret->index != NULL) OPENSSL_free(ret->index);
if (ret->qual != NULL) OPENSSL_free(ret->qual);
if (ret != NULL) OPENSSL_free(ret);
......@@ -231,15 +232,15 @@ int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(STRING *),
db->error=DB_ERROR_MALLOC;
return(0);
}
n=sk_num(db->data);
n=sk_PSTRING_num(db->data);
for (i=0; i<n; i++)
{
r=(STRING *)sk_value(db->data,i);
r=sk_PSTRING_value(db->data,i);
if ((qual != NULL) && (qual(r) == 0)) continue;
if ((r=lh_STRING_insert(idx,r)) != NULL)
{
db->error=DB_ERROR_INDEX_CLASH;
db->arg1=sk_find(db->data,(char *)r);
db->arg1=sk_PSTRING_find(db->data,r);
db->arg2=i;
lh_STRING_free(idx);
return(0);
......@@ -260,11 +261,11 @@ long TXT_DB_write(BIO *out, TXT_DB *db)
if ((buf=BUF_MEM_new()) == NULL)
goto err;
n=sk_num(db->data);
n=sk_PSTRING_num(db->data);
nn=db->num_fields;
for (i=0; i<n; i++)
{
pp=(char **)sk_value(db->data,i);
pp=sk_PSTRING_value(db->data,i);
l=0;
for (j=0; j<nn; j++)
......@@ -321,7 +322,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row)
}
}
/* We have passed the index checks, now just append and insert */
if (!sk_push(db->data,(char *)row))
if (!sk_PSTRING_push(db->data,row))
{
db->error=DB_ERROR_MALLOC;
goto err;
......@@ -359,11 +360,11 @@ void TXT_DB_free(TXT_DB *db)
OPENSSL_free(db->qual);
if (db->data != NULL)
{
for (i=sk_num(db->data)-1; i>=0; i--)
for (i=sk_PSTRING_num(db->data)-1; i>=0; i--)
{
/* check if any 'fields' have been allocated
* from outside of the initial block */
p=(char **)sk_value(db->data,i);
p=sk_PSTRING_value(db->data,i);
max=p[db->num_fields]; /* last address */
if (max == NULL) /* new row */
{
......@@ -379,9 +380,9 @@ void TXT_DB_free(TXT_DB *db)
OPENSSL_free(p[n]);
}
}
OPENSSL_free(sk_value(db->data,i));
OPENSSL_free(sk_PSTRING_value(db->data,i));
}
sk_free(db->data);
sk_PSTRING_free(db->data);
}
OPENSSL_free(db);
}
......@@ -77,10 +77,13 @@
extern "C" {
#endif
typedef STRING *PSTRING;
DECLARE_SPECIAL_STACK_OF(PSTRING, STRING)
typedef struct txt_db_st
{
int num_fields;
STACK /* char ** */ *data;
STACK_OF(PSTRING) *data;
LHASH_OF(STRING) **index;
int (**qual)(STRING *);
long error;
......
......@@ -67,9 +67,9 @@
static char *strip_spaces(char *name);
static int sk_strcmp(const char * const *a, const char * const *b);
static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens);
static void str_free(void *str);
static int append_ia5(STACK **sk, ASN1_IA5STRING *email);
static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens);
static void str_free(STRING str);
static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email);
static int ipv4_from_asc(unsigned char *v4, const char *in);
static int ipv6_from_asc(unsigned char *v6, const char *in);
......@@ -463,21 +463,23 @@ static int sk_strcmp(const char * const *a, const char * const *b)
return strcmp(*a, *b);
}
STACK *X509_get1_email(X509 *x)
STACK_OF(STRING) *X509_get1_email(X509 *x)
{
GENERAL_NAMES *gens;
STACK *ret;
STACK_OF(STRING) *ret;
gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
ret = get_email(X509_get_subject_name(x), gens);
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
return ret;
}
STACK *X509_get1_ocsp(X509 *x)
STACK_OF(STRING) *X509_get1_ocsp(X509 *x)
{
AUTHORITY_INFO_ACCESS *info;
STACK *ret = NULL;
STACK_OF(STRING) *ret = NULL;
int i;
info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL);
if (!info)
return NULL;
......@@ -497,11 +499,12 @@ STACK *X509_get1_ocsp(X509 *x)
return ret;
}
STACK *X509_REQ_get1_email(X509_REQ *x)
STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x)
{
GENERAL_NAMES *gens;
STACK_OF(X509_EXTENSION) *exts;
STACK *ret;
STACK_OF(STRING) *ret;
exts = X509_REQ_get_extensions(x);
gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL);
ret = get_email(X509_REQ_get_subject_name(x), gens);
......@@ -511,9 +514,9 @@ STACK *X509_REQ_get1_email(X509_REQ *x)
}
static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens)
static STACK_OF(STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens)
{
STACK *ret = NULL;
STACK_OF(STRING) *ret = NULL;
X509_NAME_ENTRY *ne;
ASN1_IA5STRING *email;
GENERAL_NAME *gen;
......@@ -536,23 +539,23 @@ static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens)
return ret;
}
static void str_free(void *str)
static void str_free(STRING str)
{
OPENSSL_free(str);
}
static int append_ia5(STACK **sk, ASN1_IA5STRING *email)
static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email)
{
char *emtmp;
/* First some sanity checks */
if(email->type != V_ASN1_IA5STRING) return 1;
if(!email->data || !email->length) return 1;
if(!*sk) *sk = sk_new(sk_strcmp);
if(!*sk) *sk = sk_STRING_new(sk_strcmp);
if(!*sk) return 0;
/* Don't add duplicates */
if(sk_find(*sk, (char *)email->data) != -1) return 1;
emtmp = BUF_strdup((char *)email->data);
if(!emtmp || !sk_push(*sk, emtmp)) {
if(sk_STRING_find(*sk, (char *)email->data) != -1) return 1;
emtmp = BUF_strdup(email->data);
if(!emtmp || !sk_STRING_push(*sk, emtmp)) {
X509_email_free(*sk);
*sk = NULL;
return 0;
......@@ -560,9 +563,9 @@ static int append_ia5(STACK **sk, ASN1_IA5STRING *email)
return 1;
}
void X509_email_free(STACK *sk)
void X509_email_free(STACK_OF(STRING) *sk)
{
sk_pop_free(sk, str_free);
sk_STRING_pop_free(sk, str_free);
}
/* Convert IP addresses both IPv4 and IPv6 into an
......
......@@ -661,10 +661,10 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
void X509_PURPOSE_cleanup(void);
int X509_PURPOSE_get_id(X509_PURPOSE *);
STACK *X509_get1_email(X509 *x);
STACK *X509_REQ_get1_email(X509_REQ *x);
void X509_email_free(STACK *sk);
STACK *X509_get1_ocsp(X509 *x);
STACK_OF(STRING) *X509_get1_email(X509 *x);
STACK_OF(STRING) *X509_REQ_get1_email(X509_REQ *x);
void X509_email_free(STACK_OF(STRING) *sk);
STACK_OF(STRING) *X509_get1_ocsp(X509 *x);
ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
......
......@@ -183,24 +183,48 @@ e_aep.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_aep.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_aep.o: ../include/openssl/crypto.h ../include/openssl/dh.h
e_aep.o: ../include/openssl/dsa.h ../include/openssl/dso.h
e_aep.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
e_aep.o: ../include/openssl/err.h ../include/openssl/lhash.h
e_aep.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_aep.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_aep.o: ../include/openssl/engine.h ../include/openssl/err.h
e_aep.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_aep.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_aep.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_aep.o: ../include/openssl/ossl_typ.h ../include/openssl/rsa.h
e_aep.o: ../include/openssl/safestack.h ../include/openssl/stack.h
e_aep.o: ../include/openssl/symhacks.h e_aep.c e_aep_err.c e_aep_err.h
e_aep.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_aep.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_aep.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_aep.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_aep.o: ../include/openssl/x509_vfy.h e_aep.c e_aep_err.c e_aep_err.h
e_aep.o: vendor_defns/aep.h
e_atalla.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_atalla.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_atalla.o: ../include/openssl/crypto.h ../include/openssl/dh.h
e_atalla.o: ../include/openssl/dsa.h ../include/openssl/dso.h
e_atalla.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
e_atalla.o: ../include/openssl/err.h ../include/openssl/lhash.h
e_atalla.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_atalla.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_atalla.o: ../include/openssl/engine.h ../include/openssl/err.h
e_atalla.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_atalla.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_atalla.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_atalla.o: ../include/openssl/ossl_typ.h ../include/openssl/rsa.h
e_atalla.o: ../include/openssl/safestack.h ../include/openssl/stack.h
e_atalla.o: ../include/openssl/symhacks.h e_atalla.c e_atalla_err.c
e_atalla.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_atalla.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_atalla.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_atalla.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_atalla.o: ../include/openssl/x509_vfy.h e_atalla.c e_atalla_err.c
e_atalla.o: e_atalla_err.h vendor_defns/atalla.h
e_capi.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_capi.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_capi.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
e_capi.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
e_capi.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
e_capi.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_capi.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_capi.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_capi.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
e_capi.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
e_capi.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_capi.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_capi.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_capi.o: ../include/openssl/x509_vfy.h e_capi.c
e_chil.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_chil.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_chil.o: ../include/openssl/crypto.h ../include/openssl/dh.h
......@@ -222,40 +246,60 @@ e_cswift.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_cswift.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_cswift.o: ../include/openssl/crypto.h ../include/openssl/dh.h
e_cswift.o: ../include/openssl/dsa.h ../include/openssl/dso.h
e_cswift.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
e_cswift.o: ../include/openssl/err.h ../include/openssl/lhash.h
e_cswift.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_cswift.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_cswift.o: ../include/openssl/engine.h ../include/openssl/err.h
e_cswift.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_cswift.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_cswift.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_cswift.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
e_cswift.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_cswift.o: ../include/openssl/stack.h ../include/openssl/symhacks.h e_cswift.c
e_cswift.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_cswift.o: ../include/openssl/rand.h ../include/openssl/rsa.h
e_cswift.o: ../include/openssl/safestack.h ../include/openssl/sha.h
e_cswift.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
e_cswift.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h e_cswift.c
e_cswift.o: e_cswift_err.c e_cswift_err.h vendor_defns/cswift.h
e_gmp.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_gmp.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_gmp.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
e_gmp.o: ../include/openssl/engine.h ../include/openssl/opensslconf.h
e_gmp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
e_gmp.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
e_gmp.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
e_gmp.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_gmp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_gmp.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_gmp.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_gmp.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_gmp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h e_gmp.c
e_gmp.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_gmp.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_gmp.o: ../include/openssl/x509_vfy.h e_gmp.c
e_nuron.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_nuron.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_nuron.o: ../include/openssl/crypto.h ../include/openssl/dh.h
e_nuron.o: ../include/openssl/dsa.h ../include/openssl/dso.h
e_nuron.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
e_nuron.o: ../include/openssl/err.h ../include/openssl/lhash.h
e_nuron.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_nuron.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_nuron.o: ../include/openssl/engine.h ../include/openssl/err.h
e_nuron.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_nuron.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_nuron.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_nuron.o: ../include/openssl/ossl_typ.h ../include/openssl/rsa.h
e_nuron.o: ../include/openssl/safestack.h ../include/openssl/stack.h
e_nuron.o: ../include/openssl/symhacks.h e_nuron.c e_nuron_err.c e_nuron_err.h
e_nuron.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_nuron.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_nuron.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_nuron.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_nuron.o: ../include/openssl/x509_vfy.h e_nuron.c e_nuron_err.c e_nuron_err.h
e_padlock.o: ../include/openssl/aes.h ../include/openssl/asn1.h
e_padlock.o: ../include/openssl/bio.h ../include/openssl/crypto.h
e_padlock.o: ../include/openssl/dso.h ../include/openssl/e_os2.h
e_padlock.o: ../include/openssl/bio.h ../include/openssl/buffer.h
e_padlock.o: ../include/openssl/crypto.h ../include/openssl/dso.h
e_padlock.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_padlock.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_padlock.o: ../include/openssl/engine.h ../include/openssl/err.h
e_padlock.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_padlock.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_padlock.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_padlock.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h
e_padlock.o: ../include/openssl/safestack.h ../include/openssl/stack.h
e_padlock.o: ../include/openssl/symhacks.h e_padlock.c
e_padlock.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_padlock.o: ../include/openssl/rand.h ../include/openssl/safestack.h
e_padlock.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_padlock.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_padlock.o: ../include/openssl/x509_vfy.h e_padlock.c
e_sureware.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_sureware.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_sureware.o: ../include/openssl/crypto.h ../include/openssl/dh.h
......@@ -278,10 +322,15 @@ e_ubsec.o: ../include/openssl/asn1.h ../include/openssl/bio.h
e_ubsec.o: ../include/openssl/bn.h ../include/openssl/buffer.h
e_ubsec.o: ../include/openssl/crypto.h ../include/openssl/dh.h
e_ubsec.o: ../include/openssl/dsa.h ../include/openssl/dso.h
e_ubsec.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
e_ubsec.o: ../include/openssl/err.h ../include/openssl/lhash.h
e_ubsec.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
e_ubsec.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
e_ubsec.o: ../include/openssl/engine.h ../include/openssl/err.h
e_ubsec.o: ../include/openssl/evp.h ../include/openssl/lhash.h
e_ubsec.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
e_ubsec.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
e_ubsec.o: ../include/openssl/ossl_typ.h ../include/openssl/rsa.h
e_ubsec.o: ../include/openssl/safestack.h ../include/openssl/stack.h
e_ubsec.o: ../include/openssl/symhacks.h e_ubsec.c e_ubsec_err.c e_ubsec_err.h
e_ubsec.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
e_ubsec.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
e_ubsec.o: ../include/openssl/sha.h ../include/openssl/stack.h
e_ubsec.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
e_ubsec.o: ../include/openssl/x509_vfy.h e_ubsec.c e_ubsec_err.c e_ubsec_err.h
e_ubsec.o: vendor_defns/hw_ubsec.h
此差异已折叠。
......@@ -492,41 +492,58 @@ ecdhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
ecdhtest.o: ../include/openssl/sha.h ../include/openssl/stack.h
ecdhtest.o: ../include/openssl/symhacks.h ecdhtest.c
ecdsatest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
ecdsatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
ecdsatest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
ecdsatest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
ecdsatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ecdsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
ecdsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
ecdsatest.o: ../include/openssl/err.h ../include/openssl/evp.h
ecdsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
ecdsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ecdsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
ecdsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
ecdsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
ecdsatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
ecdsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
ecdsatest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
ecdsatest.o: ecdsatest.c
ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
ectest.o: ../include/openssl/bn.h ../include/openssl/crypto.h
ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
ectest.o: ../include/openssl/engine.h ../include/openssl/err.h
ectest.o: ../include/openssl/bn.h ../include/openssl/buffer.h
ectest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ectest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
ectest.o: ../include/openssl/err.h ../include/openssl/evp.h
ectest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
ectest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
ectest.o: ../include/openssl/rand.h ../include/openssl/safestack.h
ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h ectest.c
enginetest.o: ../include/openssl/bio.h ../include/openssl/buffer.h
enginetest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
ectest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
ectest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
ectest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ectest.c
enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h
enginetest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
enginetest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
enginetest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h
enginetest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
enginetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
enginetest.o: ../include/openssl/safestack.h ../include/openssl/stack.h
enginetest.o: ../include/openssl/symhacks.h enginetest.c
enginetest.o: ../include/openssl/evp.h ../include/openssl/lhash.h
enginetest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
enginetest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
enginetest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
enginetest.o: ../include/openssl/safestack.h ../include/openssl/sha.h
enginetest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
enginetest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
enginetest.o: enginetest.c
evp_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h
evp_test.o: ../include/openssl/e_os2.h ../include/openssl/engine.h
evp_test.o: ../include/openssl/buffer.h ../include/openssl/conf.h
evp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
evp_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
evp_test.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h
evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h
evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
evp_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h
evp_test.o: ../include/openssl/symhacks.h evp_test.c
evp_test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h
evp_test.o: ../include/openssl/sha.h ../include/openssl/stack.h
evp_test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
evp_test.o: ../include/openssl/x509_vfy.h evp_test.c
exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h
exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册