More tweaks for comments due indent issues
[openssl.git] / ssl / ssl_task.c
index 05f9325904577d1222a8bc21e25a639fea783e84..4381647f2e99664482e98010327db277db60b48b 100644 (file)
@@ -57,7 +57,7 @@
  */
 
 /* VMS */
-/*
+/*-
  * DECnet object for servicing SSL.  We accept the inbound and speak a
  * simple protocol for multiplexing the 2 data streams (application and
  * ssl data) over this logical link.
@@ -123,8 +123,10 @@ int LIB$INIT_TIMER(), LIB$SHOW_TIMER();
 
 #include <string.h>            /* from ssltest.c */
 #include <errno.h>
+
+#include "e_os.h"
+
 #include <openssl/buffer.h>
-#include "../e_os.h"
 #include <openssl/x509.h>
 #include <openssl/ssl.h>
 #include <openssl/err.h>
@@ -142,11 +144,16 @@ static int s_nbio=0;
 #endif
 #define TEST_SERVER_CERT "SSL_SERVER_CERTIFICATE"
 /*************************************************************************/
-struct rpc_msg {               /* Should have member alignment inhibited */
-   char channel;               /* 'A'-app data. 'R'-remote client 'G'-global */
-   char function;              /* 'G'-get, 'P'-put, 'C'-confirm, 'X'-close */
-   unsigned short int length;  /* Amount of data returned or max to return */
-   char data[4092];            /* variable data */
+/* Should have member alignment inhibited */
+struct rpc_msg {
+    /* 'A'-app data. 'R'-remote client 'G'-global */
+   char channel;
+   /* 'G'-get, 'P'-put, 'C'-confirm, 'X'-close */
+   char function;
+   /* Amount of data returned or max to return */
+   unsigned short int length;
+   /* variable data */
+   char data[4092];
 };
 #define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092)
 
@@ -224,8 +231,12 @@ int main ( int argc, char **argv )
        printf("cipher list: %s\n", cipher ? cipher : "{undefined}" );
 
        SSL_load_error_strings();
+       OpenSSL_add_all_algorithms();
 
+/* DRM, this was the original, but there is no such thing as SSLv2()
        s_ctx=SSL_CTX_new(SSLv2());
+*/
+       s_ctx=SSL_CTX_new(SSLv2_server_method());
 
        if (s_ctx == NULL) goto end;
 
@@ -252,7 +263,7 @@ int doit(io_channel chan, SSL_CTX *s_ctx )
 {
     int status, length, link_state;
      struct rpc_msg msg;
-       static char cbuf[200],sbuf[200];
+
        SSL *s_ssl=NULL;
        BIO *c_to_s=NULL;
        BIO *s_to_c=NULL;
@@ -267,8 +278,12 @@ int doit(io_channel chan, SSL_CTX *s_ctx )
        c_to_s=BIO_new(BIO_s_rtcp());
        s_to_c=BIO_new(BIO_s_rtcp());
        if ((s_to_c == NULL) || (c_to_s == NULL)) goto err;
+/*- original, DRM 24-SEP-1997
        BIO_set_fd ( c_to_s, "", chan );
        BIO_set_fd ( s_to_c, "", chan );
+*/
+       BIO_set_fd ( c_to_s, 0, chan );
+       BIO_set_fd ( s_to_c, 0, chan );
 
        c_bio=BIO_new(BIO_f_ssl());
        s_bio=BIO_new(BIO_f_ssl());