Changeset 47bcf6f in nscp for include/nsca


Ignore:
Timestamp:
02/14/10 08:47:11 (3 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
60375ed
Parents:
40970de
Message:

Added crypto++ to cmake build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/nsca/nsca_enrypt.hpp

    r40970de r47bcf6f  
    9292      } 
    9393 
     94      virtual void init(std::string password, std::string iv) { 
     95        init(password, (unsigned char*)&*iv.begin(), iv.size()); 
     96 
     97      } 
    9498      void init(std::string password, unsigned char *transmitted_iv, int iv_size) { 
    9599        /* generate an encryption/description key using the password */ 
     
    127131        delete [] iv; 
    128132        delete [] key; 
     133      } 
     134      void encrypt(std::string &buffer) { 
     135        encrypt((unsigned char*)&*buffer.begin(), buffer.size()); 
    129136      } 
    130137      void encrypt(unsigned char *buffer, int buffer_size) { 
     
    136143          throw encryption_exception(_T("Unknown exception when trying to setup crypto")); 
    137144        } 
     145      } 
     146      void decrypt(std::string &buffer) { 
     147        decrypt((unsigned char*)&*buffer.begin(), buffer.size()); 
    138148      } 
    139149      void decrypt(unsigned char *buffer, int buffer_size) { 
     
    328338#if HAVE_LIBCRYPTOPP 
    329339      CryptoPP::AutoSeededRandomPool rng; 
    330       rng.GenerateBlock(buffer, length); 
     340      rng.GenerateBlock((byte*)&*buffer.begin(), length); 
    331341#endif 
    332342      return buffer; 
Note: See TracChangeset for help on using the changeset viewer.