Some code formating
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the copyright holder nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
@@ -42,7 +42,7 @@ class DRMProcessorClientImpl : public gourou::DRMProcessorClient
|
||||
public:
|
||||
DRMProcessorClientImpl();
|
||||
~DRMProcessorClientImpl();
|
||||
|
||||
|
||||
/* Digest interface */
|
||||
virtual void* createDigest(const std::string& digestName);
|
||||
virtual void digestUpdate(void* handler, unsigned char* data, unsigned int length);
|
||||
@@ -56,83 +56,83 @@ public:
|
||||
virtual std::string sendHTTPRequest(const std::string& URL, const std::string& POSTData=std::string(""), const std::string& contentType=std::string(""), std::map<std::string, std::string>* responseHeaders=0, int fd=0, bool resume=false);
|
||||
|
||||
virtual void RSAPrivateEncrypt(const unsigned char* RSAKey, unsigned int RSAKeyLength,
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
|
||||
virtual void RSAPrivateDecrypt(const unsigned char* RSAKey, unsigned int RSAKeyLength,
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
|
||||
virtual void RSAPublicEncrypt(const unsigned char* RSAKey, unsigned int RSAKeyLength,
|
||||
const RSA_KEY_TYPE keyType,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
const RSA_KEY_TYPE keyType,
|
||||
const unsigned char* data, unsigned dataLength,
|
||||
unsigned char* res);
|
||||
|
||||
virtual void* generateRSAKey(int keyLengthBits);
|
||||
virtual void destroyRSAHandler(void* handler);
|
||||
|
||||
|
||||
virtual void extractRSAPublicKey(void* RSAKeyHandler, unsigned char** keyOut, unsigned int* keyOutLength);
|
||||
virtual void extractRSAPrivateKey(void* RSAKeyHandler, unsigned char** keyOut, unsigned int* keyOutLength);
|
||||
virtual void extractCertificate(const unsigned char* RSAKey, unsigned int RSAKeyLength,
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
unsigned char** certOut, unsigned int* certOutLength);
|
||||
|
||||
const RSA_KEY_TYPE keyType, const std::string& password,
|
||||
unsigned char** certOut, unsigned int* certOutLength);
|
||||
|
||||
/* Crypto interface */
|
||||
virtual void encrypt(CRYPTO_ALGO algo, CHAINING_MODE chaining,
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv, unsigned int ivLength,
|
||||
const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv, unsigned int ivLength,
|
||||
const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
|
||||
virtual void* encryptInit(CRYPTO_ALGO algo, CHAINING_MODE chaining,
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv=0, unsigned int ivLength=0);
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv=0, unsigned int ivLength=0);
|
||||
|
||||
|
||||
virtual void encryptUpdate(void* handler, const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
virtual void encryptFinalize(void* handler, unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
|
||||
virtual void decrypt(CRYPTO_ALGO algo, CHAINING_MODE chaining,
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv, unsigned int ivLength,
|
||||
const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv, unsigned int ivLength,
|
||||
const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
|
||||
virtual void* decryptInit(CRYPTO_ALGO algo, CHAINING_MODE chaining,
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv=0, unsigned int ivLength=0);
|
||||
const unsigned char* key, unsigned int keyLength,
|
||||
const unsigned char* iv=0, unsigned int ivLength=0);
|
||||
|
||||
virtual void decryptUpdate(void* handler, const unsigned char* dataIn, unsigned int dataInLength,
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
virtual void decryptFinalize(void* handler, unsigned char* dataOut, unsigned int* dataOutLength);
|
||||
|
||||
/* ZIP Interface */
|
||||
virtual void* zipOpen(const std::string& path);
|
||||
|
||||
|
||||
virtual void zipReadFile(void* handler, const std::string& path, gourou::ByteArray& result, bool decompress=true);
|
||||
|
||||
|
||||
virtual void zipWriteFile(void* handler, const std::string& path, gourou::ByteArray& content);
|
||||
|
||||
|
||||
virtual void zipDeleteFile(void* handler, const std::string& path);
|
||||
|
||||
|
||||
virtual void zipClose(void* handler);
|
||||
|
||||
|
||||
virtual void inflate(gourou::ByteArray& data, gourou::ByteArray& result,
|
||||
int wbits=-15);
|
||||
|
||||
int wbits=-15);
|
||||
|
||||
virtual void deflate(gourou::ByteArray& data, gourou::ByteArray& result,
|
||||
int wbits=-15, int compressionLevel=8);
|
||||
int wbits=-15, int compressionLevel=8);
|
||||
|
||||
private:
|
||||
|
||||
void padWithPKCS1(unsigned char* out, unsigned int outLength,
|
||||
const unsigned char* in, unsigned int inLength);
|
||||
const unsigned char* in, unsigned int inLength);
|
||||
void padWithPKCS1Type2(unsigned char* out, unsigned int outLength,
|
||||
const unsigned char* in, unsigned int inLength);
|
||||
|
||||
const unsigned char* in, unsigned int inLength);
|
||||
|
||||
#if OPENSSL_VERSION_MAJOR >= 3
|
||||
OSSL_PROVIDER *legacy, *deflt;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user