|
@ -1823,6 +1823,19 @@ class Cipher : public ObjectWrap { |
|
|
outString = Encode(out_hexdigest, out_hex_len, BINARY); |
|
|
outString = Encode(out_hexdigest, out_hex_len, BINARY); |
|
|
delete [] out_hexdigest; |
|
|
delete [] out_hexdigest; |
|
|
} else if (strcasecmp(*encoding, "base64") == 0) { |
|
|
} else if (strcasecmp(*encoding, "base64") == 0) { |
|
|
|
|
|
// Check to see if we need to add in previous base64 overhang
|
|
|
|
|
|
if (cipher->incomplete_base64!=NULL){ |
|
|
|
|
|
unsigned char* complete_base64 = new unsigned char[out_len+cipher->incomplete_base64_len+1]; |
|
|
|
|
|
memcpy(complete_base64, cipher->incomplete_base64, cipher->incomplete_base64_len); |
|
|
|
|
|
memcpy(&complete_base64[cipher->incomplete_base64_len], out_value, out_len); |
|
|
|
|
|
delete [] out_value; |
|
|
|
|
|
|
|
|
|
|
|
delete [] cipher->incomplete_base64; |
|
|
|
|
|
cipher->incomplete_base64=NULL; |
|
|
|
|
|
|
|
|
|
|
|
out_value=complete_base64; |
|
|
|
|
|
out_len += cipher->incomplete_base64_len; |
|
|
|
|
|
} |
|
|
base64(out_value, out_len, &out_hexdigest, &out_hex_len); |
|
|
base64(out_value, out_len, &out_hexdigest, &out_hex_len); |
|
|
outString = Encode(out_hexdigest, out_hex_len, BINARY); |
|
|
outString = Encode(out_hexdigest, out_hex_len, BINARY); |
|
|
delete [] out_hexdigest; |
|
|
delete [] out_hexdigest; |
|
|