summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2002-01-23 17:26:51 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2002-01-23 17:26:51 +0000
commit76fa677b2df6561c6eb4e18746169891c8d0b2c3 (patch)
treef6b0213b66b37c3b144e059e166a48cc760e6652 /TAO
parent23d428b68a569389a8d469373a775951520a1fce (diff)
downloadATCD-76fa677b2df6561c6eb4e18746169891c8d0b2c3.tar.gz
ChangeLogTag:Wed Jan 23 09:25:31 2002 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a10
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp51
-rw-r--r--TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h9
3 files changed, 50 insertions, 20 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index abba2fda47c..6f2daa0d2da 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,13 @@
+Wed Jan 23 09:25:31 2002 Ossama Othman <ossama@uci.edu>
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h:
+
+ Corrected some documentation.
+
+ * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp (is_valid):
+
+ Implemented this method.
+
Wed Jan 23 11:05:04 2002 Jeff Parsons <parsons@cs.wustl.edu>
* examples/Quoter/Quoter.idl:
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp
index e06d06f2d87..dbad1dfe1a3 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Credentials.cpp
@@ -266,30 +266,47 @@ TAO_SSLIOP_Credentials::is_valid (
TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
-#if 0
+ X509 *x = this->x509_.in ();
+
// The pointer to the underlying X509 structure should only be zero
// if destroy() was called on this Credentials object.
- if (this->x509_.in () == 0)
+ if (x == 0)
ACE_THROW_RETURN (CORBA::BAD_OPERATION (), 0);
- const ASN1_UTCTIME *expiration = X509_get_notAfter (this->x509_.in ());
+ int before_status = ::X509_cmp_current_time (X509_get_notBefore (x));
+ int after_status = ::X509_cmp_current_time (X509_get_notAfter (x));
- // @todo Fill in expiry_time.
+ if (before_status == 0 || after_status == 0)
+ {
+ // Error in certificate's "not before" or "not after" field.
+ ACE_THROW_RETURN (CORBA::BAD_PARAM (), // @@ Correct exception?
+ 0);
+ }
- // @todo Use of ACE_OS::time() may not be appropriate since it
- // represents a 32-bit value on some platforms.
+ ASN1_TIME *exp = X509_get_notAfter (x);
- return (::ASN1_UTCTIME_cmp_time_t (expiration,
- ACE_OS::time (0)) == -1 ? 0 : 1);
-#else
- ACE_UNUSED_ARG (expiry_time);
- ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
- CORBA::SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- ENOTSUP),
- CORBA::COMPLETED_NO),
- 0);
-#endif
+ if (exp->length > ACE_SIZEOF_LONG_LONG)
+ {
+ // @@ Will this ever happen?
+
+ // Overflow!
+ expiry_time.time = ACE_UINT64_LITERAL (0xffffffffffffffff);
+ }
+ else
+ {
+ expiry_time.time = 0;
+ for (int i = 0; i < exp->length; ++i)
+ {
+ expiry_time.time <<= 8;
+ expiry_time.time |= (unsigned char) exp->data[i];
+ }
+ }
+
+ if (before_status > 0 // Certificate is not yet valid.
+ || after_status < 0) // Certificate is expired.
+ return 0;
+
+ return 1;
}
CORBA::Boolean
diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
index 422f9bb3b08..da6c1d49fd8 100644
--- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
+++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h
@@ -31,8 +31,9 @@
#include "SSLIOP_Credentials.h"
+
/// Tag for storing multiple ssl endpoints within a single profile.
-#define TAO_TAG_SSL_ENDPOINTS 0x54414f01U
+const ACE_UINT32 TAO_TAG_SSL_ENDPOINTS = 0x54414f01U;
/**
@@ -40,6 +41,8 @@
*
* @brief SSLIOP-specific implementation of PP Framework Endpoint
* interface.
+ *
+ *
*/
class TAO_SSLIOP_Export TAO_SSLIOP_Endpoint : public TAO_Endpoint
{
@@ -115,10 +118,10 @@ public:
/// Get the establishment of trust settings for this endpoint.
Security::EstablishTrust trust (void) const;
- /// Set the establishment of trust settings for this endpoint.
+ /// Set the credentials for this endpoint.
void credentials (TAO_SSLIOP_Credentials_ptr creds);
- /// Get the establishment of trust settings for this endpoint.
+ /// Get the credentials for this endpoint.
/**
* @note This method does not follow C++ mapping memory management
* rules. Specifically, no duplication or reference counting