diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-03-19 15:39:33 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-03-19 15:39:33 +0000 |
commit | c210b6ff1ef66fd972c40bcc07db28231099e7b4 (patch) | |
tree | f274afcfff721976a71b3389f373ab759c8e5fa3 /cpp/src/Ice/Cryptor.cpp | |
parent | Updated the properties added to the SSL extension, and those added for (diff) | |
download | ice-c210b6ff1ef66fd972c40bcc07db28231099e7b4.tar.bz2 ice-c210b6ff1ef66fd972c40bcc07db28231099e7b4.tar.xz ice-c210b6ff1ef66fd972c40bcc07db28231099e7b4.zip |
Removed the SUDP implementation (for now). See the tag sudp in CVS to
recover.
Diffstat (limited to 'cpp/src/Ice/Cryptor.cpp')
-rw-r--r-- | cpp/src/Ice/Cryptor.cpp | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/cpp/src/Ice/Cryptor.cpp b/cpp/src/Ice/Cryptor.cpp deleted file mode 100644 index 563b315de5e..00000000000 --- a/cpp/src/Ice/Cryptor.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2002 -// MutableRealms, Inc. -// Huntsville, AL, USA -// -// All Rights Reserved -// -// ********************************************************************** - -#include <Ice/Cryptor.h> -#include <Ice/CryptKey.h> -#include <algorithm> - -void ::IceInternal::incRef(::SecureUdp::Cryptor* p) { p->__incRef(); } -void ::IceInternal::decRef(::SecureUdp::Cryptor* p) { p->__decRef(); } - -using Ice::ByteSeq; -using SecureUdp::CryptKey; -using SecureUdp::CryptKeyPtr; - -SecureUdp::Cryptor::Cryptor() -{ -} - -SecureUdp::Cryptor::~Cryptor() -{ -} - -const CryptKeyPtr -SecureUdp::Cryptor::getNewKey() -{ - // Gotta return a newly generated key here. - ByteSeq byteSeq; - - // Bogus key - gotta fix this. - byteSeq.push_back('A'); - byteSeq.push_back('n'); - byteSeq.push_back('t'); - byteSeq.push_back('h'); - byteSeq.push_back('o'); - byteSeq.push_back('n'); - byteSeq.push_back('y'); - byteSeq.push_back('D'); - byteSeq.push_back('a'); - byteSeq.push_back('r'); - byteSeq.push_back('i'); - byteSeq.push_back('u'); - byteSeq.push_back('s'); - - CryptKeyPtr cryptKey = new CryptKey(byteSeq); - - _cryptKeys.push_back(cryptKey); - - return cryptKey; -} - -const CryptKeyPtr -SecureUdp::Cryptor::getKey(const ByteSeq& key) -{ - CryptKeyPtr cryptKey = new CryptKey(key); - - CryptKeys::iterator begin = _cryptKeys.begin(); - CryptKeys::iterator end = _cryptKeys.end(); - CryptKeys::iterator pos = std::find(begin, end, cryptKey); - - if (pos == end) - { - // TODO: Exception - Trying to use a key that we didn't hand out. - } - - return *pos; -} - -const CryptKeyPtr -SecureUdp::Cryptor::getOrCreateKey(const ByteSeq& key) -{ - CryptKeyPtr cryptKey; - - cryptKey = getKey(key); - - if (cryptKey == 0) - { - cryptKey = new CryptKey(key); - - _cryptKeys.push_back(cryptKey); - } - - return cryptKey; -} - -void -SecureUdp::Cryptor::encrypt(const CryptKeyPtr& key, const ByteSeq& plainBuffer, ByteSeq& encryptedBuffer) -{ - encryptedBuffer = plainBuffer; -} - -void -SecureUdp::Cryptor::decrypt(const CryptKeyPtr& key, const ByteSeq& encryptedBuffer, ByteSeq& plainBuffer) -{ - plainBuffer = encryptedBuffer; -} |