Fix shadow.
[openssl.git] / apps / ciphers.c
index 16ff2b49275dbbe25a9139918b5212170d75faf8..f8e9e7be2e6d5053f55edc49b990b2638a11e2c0 100644 (file)
@@ -1,5 +1,5 @@
 /* apps/ciphers.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef WIN16
+#ifdef NO_STDIO
 #define APPS_WIN16
 #endif
 #include "apps.h"
-#include "err.h"
-#include "ssl.h"
+#include <openssl/err.h>
+#include <openssl/ssl.h>
 
 #undef PROG
 #define PROG   ciphers_main
@@ -77,19 +77,20 @@ static char *ciphers_usage[]={
 NULL
 };
 
-int MAIN(argc, argv)
-int argc;
-char **argv;
+int MAIN(int, char **);
+
+int MAIN(int argc, char **argv)
        {
        int ret=1,i;
        int verbose=0;
-       char **pp,*p;
+       char **pp;
+       const char *p;
        int badops=0;
        SSL_CTX *ctx=NULL;
        SSL *ssl=NULL;
        char *ciphers=NULL;
        SSL_METHOD *meth=NULL;
-       STACK *sk;
+       STACK_OF(SSL_CIPHER) *sk;
        char buf[512];
        BIO *STDout=NULL;
 
@@ -142,12 +143,16 @@ char **argv;
                goto end;
                }
 
-       SSLeay_add_ssl_algorithms();
+       OpenSSL_add_ssl_algorithms();
 
        ctx=SSL_CTX_new(meth);
        if (ctx == NULL) goto err;
-       if (ciphers != NULL)
-               SSL_CTX_set_cipher_list(ctx,ciphers);
+       if (ciphers != NULL) {
+               if(!SSL_CTX_set_cipher_list(ctx,ciphers)) {
+                       BIO_printf(bio_err, "Error in cipher list\n");
+                       goto err;
+               }
+       }
        ssl=SSL_new(ctx);
        if (ssl == NULL) goto err;
 
@@ -167,10 +172,10 @@ char **argv;
                {
                sk=SSL_get_ciphers(ssl);
 
-               for (i=0; i<sk_num(sk); i++)
+               for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
                        {
                        BIO_puts(STDout,SSL_CIPHER_description(
-                               (SSL_CIPHER *)sk_value(sk,i),
+                               sk_SSL_CIPHER_value(sk,i),
                                buf,512));
                        }
                }