]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixes openssl-1.0.0 compilation warning
authorchantra <chantra@debuntu.org>
Fri, 16 Jul 2010 18:09:07 +0000 (20:09 +0200)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Thu, 21 Oct 2010 09:40:36 +0000 (11:40 +0200)
When compiling against OpenSSL v1.0.0, the following compiler warnings
appears.

ssl.c: In function ‘verify_callback’:
ssl.c:944: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c:947: warning: passing argument 1 of ‘sk_value’ from incompatible
pointer type
/usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c: In function ‘init_ssl’:
ssl.c:1565: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509 *’
ssl.c: In function ‘print_details’:
ssl.c:1766: warning: assignment discards qualifiers from pointer target type

Trac ticket #5
https://community.openvpn.net/openvpn/ticket/5

Signed-off-by: chantra <chantra@debuntu.org>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
ssl.c

diff --git a/ssl.c b/ssl.c
index e1c6363a1830688e8c3fdabc009448afa05abfc3..b2886eb9d254aad7161f9d93934d87b8568fca1b 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -962,10 +962,10 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
        goto end;
       }
 
-      n = sk_num(X509_CRL_get_REVOKED(crl));
+      n = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl));
 
       for (i = 0; i < n; i++) {
-       revoked = (X509_REVOKED *)sk_value(X509_CRL_get_REVOKED(crl), i);
+       revoked = (X509_REVOKED *)sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), i);
        if (ASN1_INTEGER_cmp(revoked->serialNumber, X509_get_serialNumber(ctx->current_cert)) == 0) {
          msg (D_HANDSHAKE, "CRL CHECK FAILED: %s is REVOKED",subject);
          goto end;
@@ -1606,7 +1606,7 @@ init_ssl (const struct options *options)
       /* Set Certificate Verification chain */
       if (!options->ca_file)
         {
-          if (ca && sk_num(ca))
+          if (ca && sk_X509_num(ca))
             {
               for (i = 0; i < sk_X509_num(ca); i++)
                 {