type *sk_##type##_delete(STACK_OF(type) *sk,int n); \
void sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v); \
int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n); \
-void sk_##type##_set_cmp_func(STACK_OF(type) *sk,int (*cmp)(type **,type **)); \
+int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
+ int (*cmp)(type **,type **)))(type **,type **); \
STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk); \
void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)); \
type *sk_##type##_shift(STACK_OF(type) *sk); \
{ sk_delete_ptr((STACK *)sk,(char *)v); } \
int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n) \
{ return sk_insert((STACK *)sk,(char *)v,n); } \
-void sk_##type##_set_cmp_func(STACK_OF(type) *sk,int (*cmp)(type **,type **)) \
- { sk_set_cmp_func((STACK *)sk,cmp); } \
+int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
+ int (*cmp)(type **,type **)))(type **,type **) \
+ { return (int (*)(type **,type **))sk_set_cmp_func((STACK *)sk,cmp); } \
STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk) \
{ return (STACK_OF(type) *)sk_dup((STACK *)sk); } \
void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)) \
int SSL_CTX_use_certificate_file(SSL_CTX *ctx, char *file, int type);
int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */
STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
-int SSL_add_file_cert_subjects_to_stack(STACK *stackCAs,
+int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
const char *file);
-int SSL_add_dir_cert_subjects_to_stack(STACK *stackCAs,
+int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
const char *dir);
#endif
* certs may have been added to \c stack.
*/
-int SSL_add_file_cert_subjects_to_stack(STACK *stack,const char *file)
+int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
+ const char *file)
{
BIO *in;
X509 *x=NULL;
int ret=1;
int (*oldcmp)();
- oldcmp=sk_set_cmp_func(stack,name_cmp);
+ oldcmp=sk_X509_NAME_set_cmp_func(stack,name_cmp);
in=BIO_new(BIO_s_file_internal());
if ((xn=X509_get_subject_name(x)) == NULL) goto err;
xn=X509_NAME_dup(xn);
if (xn == NULL) goto err;
- if (sk_find(stack,(char *)xn) >= 0)
+ if (sk_X509_NAME_find(stack,xn) >= 0)
X509_NAME_free(xn);
else
- sk_push(stack,(char *)xn);
+ sk_X509_NAME_push(stack,xn);
}
if (0)
if(x != NULL)
X509_free(x);
- sk_set_cmp_func(stack,oldcmp);
+ sk_X509_NAME_set_cmp_func(stack,oldcmp);
return ret;
}
#ifndef WIN32
-int SSL_add_dir_cert_subjects_to_stack(STACK *stack,const char *dir)
+int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
+ const char *dir)
{
DIR *d=opendir(dir);
struct dirent *dstruct;