# $Id: IOPSSL.pm 1354 2006-06-14 00:27:26Z rvosa $ # Subversion: $Rev: 117 $ # The bits of the CORBA Security services we need in order to support # IIOP over SSL # # Copyright 1998 Secure Computing Corporation. All Rights Reserved. # See the file "Artistic" in the distribution for licensing and # (lack of) warranties. use COPE::CORBA::ORB; use Log::Log4perl; use COPE::CORBA::ORB; Log::Log4perl::init( COPE::CORBA::ORB->LOGPERLCONF ); package IOP::ComponentId; my $logger = Log::Log4perl::get_logger('IOP.ComponentId'); sub TAG_SSL_SEC_TRANS() { $logger->info(20); 20 } package Security::AssociationOptions; $logger = Log::Log4perl::get_logger('Security.AssociationOptions'); $Security::AssociationOptions::_tc = CORBA::TypeCode::_create_alias_tc( 'IDL:omg.org/Security/AssociationOptions:1.0', 'AssociationOptions', $CORBA::_tc_ushort ); sub NoProtection () { $logger->info(1); 1 } sub Integrity () { $logger->info(2); 2 } sub Confidentiality () { $logger->info(4); 4 } sub DetectReplay () { $logger->info(8); 8 } sub DetectMisordering () { $logger->info(16); 16 } sub EstablishTrustInTarget() { $logger->info(32); 32 } sub EstablishTrustInClient() { $logger->info(64); 64 } package IOPSSL::SSL; use base qw(CORBA::_Struct); use fields qw(target_supports target_requires port); $logger = Log::Log4perl::get_logger('IOPSSL.SSL'); $IOPSSL::SSL::_tc = CORBA::TypeCode::_create_struct_tc( 'IDL:omg.org/IOPSSL/SSL:1.0', 'SSL', [ target_supports => $Security::AssociationOptions::_tc, target_requires => $Security::AssociationOptions::_tc, port => $CORBA::_tc_ushort ] ); sub new { $logger->info("Creating new \"IOPSSL::SSL\" object"); my $class = shift; my IOPSSL::SSL $self = bless [ \%{"$class\::FIELDS"} ], $class; while ( my $key = shift ) { $self->{$key} = shift; } return $self; } sub _unmarshal { $logger->info("Unmarshalling"); return bless [ \%IOPSSL::SSL::FIELDS, # slight hack - Security::AssociationOptions are ushorts CORBA::ORB::_unmarshal_ushort(@_), CORBA::ORB::_unmarshal_ushort(@_), CORBA::ORB::_unmarshal_ushort(@_) ], 'IOPSSL::SSL'; } sub _marshal { $logger->info("Marshalling"); my IOPSSL::SSL $self = pop; # slight hack - Security::AssociationOptions are ushorts CORBA::ORB::_marshal_ushort( @_, $self->{target_supports} ); CORBA::ORB::_marshal_ushort( @_, $self->{target_requires} ); CORBA::ORB::_marshal_ushort( @_, $self->{port} ); } __END__ =head1 NAME IOPSSL::SSL A class to ... =head1 SYNOPSIS use IOPSSL::SSL; =head1 DESCRIPTION The IOPSSL::SSL class implements ... =head1 OPTIONS -D - show debugging information -h - show help -v - show version Other options ... =head1 SUBROUTINES =head2 new (constructor) Parameters: class Insert description of constructor here... =head2 _unmarshal (constructor) Parameters: none Insert description of constructor here... =head2 _marshal Parameters: none Insert description of subroutine here... =head1 FILES Files used by the IOPSSL::SSL class ... =head1 SEE ALSO Related information ... =head1 WARNINGS ... =head1 NOTES ... =head1 BUGS What? =cut