Convert casted X509_INFO stacks to type-safe STACK_OF(X509_INFO).

PS: Feel free to move the IMPLEMENT_STACK_OF(X509_INFO) from
    crypto/asn1/x_info.c to any other place where you think it fits better.
    X509_INFO is a structure slightly spreaded over ASN.1, X509 and PEM code,
    so I found no definitive location for IMPLEMENT_STACK_OF(X509_INFO).  In
    crypto/asn1/x_info.c it's at least now bundled with X509_INFO_new() and
    friends.
This commit is contained in:
Ralf S. Engelschall
1999-05-04 08:56:51 +00:00
parent 0f3e604589
commit 20b85fdd76
6 changed files with 27 additions and 19 deletions

View File

@@ -287,7 +287,7 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
BIO *in=NULL;
int count=0;
int ret= -1;
STACK *sk=NULL;
STACK_OF(X509_INFO) *sk=NULL;
X509_INFO *xi;
if ((stat(certfile,&st) != 0))
@@ -311,9 +311,9 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
}
/* scan over it and pull out the CRL's */
while (sk_num(sk))
while (sk_X509_INFO_num(sk))
{
xi=(X509_INFO *)sk_shift(sk);
xi=sk_X509_INFO_shift(sk);
if (xi->x509 != NULL)
{
sk_X509_push(stack,xi->x509);
@@ -327,7 +327,7 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
end:
/* never need to Free x */
if (in != NULL) BIO_free(in);
if (sk != NULL) sk_free(sk);
if (sk != NULL) sk_X509_INFO_free(sk);
return(ret);
}