00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TAO_SSLIOP_X509_H
00014 #define TAO_SSLIOP_X509_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/config-all.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #include "orbsvcs/SSLIOP/SSLIOP_OpenSSL_st_T.h"
00025
00026 #include <openssl/x509.h>
00027 #include <openssl/crypto.h>
00028
00029
00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00031
00032 namespace TAO
00033 {
00034 namespace SSLIOP
00035 {
00036
00037 template <>
00038 struct OpenSSL_traits< ::X509 >
00039 {
00040
00041
00042 enum { LOCK_ID = CRYPTO_LOCK_X509 };
00043
00044
00045
00046
00047
00048
00049
00050 static ::X509 * _duplicate (::X509 * st)
00051 {
00052 if (st != 0)
00053 CRYPTO_add (&(st->references),
00054 1,
00055 LOCK_ID);
00056
00057 return st;
00058 }
00059
00060
00061 static ::X509 * copy (::X509 const & st)
00062 {
00063 return ::X509_dup (const_cast< ::X509 *> (&st));
00064 }
00065
00066
00067
00068 static void release (::X509 * st)
00069 {
00070 ::X509_free (st);
00071 }
00072 };
00073
00074 typedef OpenSSL_st_var< ::X509 > X509_var;
00075
00076 }
00077 }
00078
00079
00080 TAO_END_VERSIONED_NAMESPACE_DECL
00081
00082 #include "ace/post.h"
00083
00084 #endif