(file) Return to SSLContext.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/SSLContext.cpp between version 1.37 and 1.38

version 1.37, 2004/08/19 21:30:07 version 1.38, 2004/09/21 20:07:43
Line 51 
Line 51 
 #include "SSLContext.h" #include "SSLContext.h"
 #include "SSLContextRep.h" #include "SSLContextRep.h"
  
   
   //
   // Typedef's for OpenSSL callback functions.
   //
   extern "C"
   {
       typedef void (* CRYPTO_SET_LOCKING_CALLBACK)(int, int, const char *, int);
       typedef unsigned long (* CRYPTO_SET_ID_CALLBACK)(void);
   };
   
   
 typedef struct Timestamp typedef struct Timestamp
 { {
     char year[4];     char year[4];
Line 167 
Line 178 
 } }
  
 // //
   // Static class used to define C++ callback function.
   //
   class SSLCallback
   {
   
   public:
           static int callback(int preVerifyOk, X509_STORE_CTX *ctx);
   };
   
   //
 // Callback function that is called by the OpenSSL library. This function // Callback function that is called by the OpenSSL library. This function
 // extracts X509 certficate information and pass that on to client application // extracts X509 certficate information and pass that on to client application
 // callback function. // callback function.
 // //
 extern "C" int prepareForCallback(int preVerifyOk, X509_STORE_CTX *ctx)  int SSLCallback::callback(int preVerifyOk, X509_STORE_CTX *ctx)
 { {
     PEG_METHOD_ENTER(TRC_SSL, "prepareForCallback()");      PEG_METHOD_ENTER(TRC_SSL, "SSLCallback::callback()");
  
     char   buf[256];     char   buf[256];
     X509   *currentCert;     X509   *currentCert;
Line 292 
Line 313 
 } }
  
 // //
   // Callback function called by OpenSSL.  This request is merely forwarded to the static
   // function SSLCallback::callback().  The SSLCallback class is a friend class of the
   // Pegasus SSL related classes needed to complete the callback.
   //
   extern "C" int prepareForCallback(int preVerifyOk, X509_STORE_CTX *ctx)
   {
       return SSLCallback::callback(preVerifyOk, ctx);
   }
   
   //
 // Implement OpenSSL locking callback. // Implement OpenSSL locking callback.
 // //
 void pegasus_locking_callback( int              mode, void pegasus_locking_callback( int              mode,
Line 329 
Line 360 
  
      // Set the ID callback. The ID callback returns a thread ID.      // Set the ID callback. The ID callback returns a thread ID.
  
      CRYPTO_set_id_callback((unsigned long (*)())pegasus_thread_self);       CRYPTO_set_id_callback((CRYPTO_SET_ID_CALLBACK) pegasus_thread_self);
  
      // Set the locking callback to pegasus_locking_callback.      // Set the locking callback to pegasus_locking_callback.
  
      CRYPTO_set_locking_callback((void (*)(int,int,const char *,int))pegasus_locking_callback);       CRYPTO_set_locking_callback((CRYPTO_SET_LOCKING_CALLBACK) pegasus_locking_callback);
  
 } }
  


Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2