45 if (in == NULL || inlen == 0)
50 EVP_ENCODE_CTX* pCTX = NULL;
51 #if OPENSSL_VERSION_NUMBER > 0x100020cfL
52 pCTX=EVP_ENCODE_CTX_new();
54 pCTX =
new EVP_ENCODE_CTX;
61 if (((out >= in) && (in + inlen > out)) || ((out < in) && (out + *outlen > in)))
64 memcpy(tmpIn, in, inlen);
65 ret = EVP_DecodeUpdate(pCTX, out, (
int*) outlen, tmpIn, (
int) inlen);
71 ret = EVP_DecodeUpdate(pCTX, out, (
int*) outlen, (
unsigned char*) in, (
int) inlen);
73 if (ret < 0 || EVP_DecodeFinal(pCTX, out + (*outlen), &
len) < 0)
82 #if OPENSSL_VERSION_NUMBER > 0x100020cfL
83 EVP_ENCODE_CTX_free(pCTX);
106 if (in == NULL || inlen == 0)
113 EVP_ENCODE_CTX* pCTX = NULL;
114 #if OPENSSL_VERSION_NUMBER > 0x100020cfL
115 pCTX=EVP_ENCODE_CTX_new();
117 pCTX =
new EVP_ENCODE_CTX;
119 EVP_EncodeInit(pCTX);
124 if (((out >= in) && (in + inlen > out)) || ((out < in) && (out + *outlen > in)))
127 memcpy(tmpIn, in, inlen);
128 EVP_EncodeUpdate(pCTX, out, (
int*) outlen, tmpIn, (
int) inlen);
134 EVP_EncodeUpdate(pCTX, out, (
int*) outlen, (
unsigned char*) in, (
int) inlen);
136 EVP_EncodeFinal(pCTX, out + (*outlen), (
int*) &
len);
138 #if OPENSSL_VERSION_NUMBER > 0x100020cfL
139 EVP_ENCODE_CTX_free(pCTX);
static SINT32 encode(const UINT8 *in, UINT32 len, UINT8 *out, UINT32 *outlen)
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...
static SINT32 decode(const UINT8 *in, UINT32 len, UINT8 *out, UINT32 *outlen)
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff...