Extend attribute setting routines to support non-string types.
[openssl.git] / crypto / x509 / by_dir.c
index f02168ab92a255ff85645fdb10608bb04b3a0f44..b355de9b1c27756296735150d98511784da9d840 100644 (file)
@@ -72,8 +72,6 @@
 #include <openssl/lhash.h>
 #include <openssl/x509.h>
 
-DECLARE_STACK_OF(BY_DIR_HASH)
-DECLARE_STACK_OF(BY_DIR_ENTRY)
 
 typedef struct lookup_dir_hashes_st
        {
@@ -94,6 +92,8 @@ typedef struct lookup_dir_st
        STACK_OF(BY_DIR_ENTRY) *dirs;
        } BY_DIR;
 
+DECLARE_STACK_OF(BY_DIR_HASH)
+DECLARE_STACK_OF(BY_DIR_ENTRY)
 
 static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
        char **ret);
@@ -230,7 +230,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
                        for (j=0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++)
                                {
                                ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
-                               if (strlen(ent->dir) == len &&
+                               if (strlen(ent->dir) == (size_t)len &&
                                    strncmp(ent->dir,ss,(unsigned int)len) == 0)
                                        break;
                                }