From c210b6ff1ef66fd972c40bcc07db28231099e7b4 Mon Sep 17 00:00:00 2001 From: Anthony Neal Date: Tue, 19 Mar 2002 15:39:33 +0000 Subject: Removed the SUDP implementation (for now). See the tag sudp in CVS to recover. --- cpp/src/Ice/MessageAuthenticator.cpp | 81 ------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 cpp/src/Ice/MessageAuthenticator.cpp (limited to 'cpp/src/Ice/MessageAuthenticator.cpp') diff --git a/cpp/src/Ice/MessageAuthenticator.cpp b/cpp/src/Ice/MessageAuthenticator.cpp deleted file mode 100644 index 42207fbdcfa..00000000000 --- a/cpp/src/Ice/MessageAuthenticator.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2002 -// MutableRealms, Inc. -// Huntsville, AL, USA -// -// All Rights Reserved -// -// ********************************************************************** - -#include - -using Ice::ByteSeq; - -void ::IceInternal::incRef(::SecureUdp::MessageAuthenticator* p) { p->__incRef(); } -void ::IceInternal::decRef(::SecureUdp::MessageAuthenticator* p) { p->__decRef(); } - -SecureUdp::MessageAuthenticator::MessageAuthenticator() -{ - // TODO: Should generate a random MAC key here - - // Bogus MAC - gotta fix this. - _macKeyBytes.push_back(2); - _macKeyBytes.push_back(0); - _macKeyBytes.push_back(0); - _macKeyBytes.push_back(2); - _macKeyBytes.push_back(0); - _macKeyBytes.push_back(1); - _macKeyBytes.push_back(1); - _macKeyBytes.push_back(7); - _macKeyBytes.push_back(1); - _macKeyBytes.push_back(0); - _macKeyBytes.push_back(2); - _macKeyBytes.push_back(2); -} - -SecureUdp::MessageAuthenticator::MessageAuthenticator(const ByteSeq& macKey) -{ - _macKeyBytes = macKey; -} - -SecureUdp::MessageAuthenticator::~MessageAuthenticator() -{ -} - -ByteSeq -SecureUdp::MessageAuthenticator::computeMAC(const ByteSeq& message) const -{ - // TODO: Should generate a REAL MAC here. - ByteSeq bytes; - - // Bogus MAC - gotta fix this. - bytes.push_back(2); - bytes.push_back(0); - bytes.push_back(0); - bytes.push_back(2); - bytes.push_back(0); - bytes.push_back(1); - bytes.push_back(1); - bytes.push_back(7); - bytes.push_back(1); - bytes.push_back(0); - bytes.push_back(2); - bytes.push_back(2); - - return bytes; -} - -bool -SecureUdp::MessageAuthenticator::authenticate(const ByteSeq& message, const ByteSeq& macCode) -{ - ByteSeq targetMAC = computeMAC(message); - return targetMAC == macCode; -} - -const ByteSeq& -SecureUdp::MessageAuthenticator::getMACKey() const -{ - return _macKeyBytes; -} - -- cgit v1.2.3