Example #1
0
func (self *CipherCtx) DecryptFinal(out []byte) (int, error) {
	outbuf := (*C.uchar)(unsafe.Pointer(&out[0]))
	var outlen C.int
	ret := C.EVP_DecryptFinal(self.evp_cipher_ctx, outbuf, &outlen)
	if int(ret) != 1 {
		return 0, errors.New("problem decrypting")
	}
	return int(outlen), nil
}
Example #2
0
func (ctx *CipherCtx) DecryptFinal(out []byte) (int, error) {
	outbuf := (*C.uchar)(unsafe.Pointer(&out[0]))
	var outlen C.int
	ret := C.EVP_DecryptFinal(ctx.evp_cipher_ctx, outbuf, &outlen)
	if int(ret) != 1 {
		//return 0, ErrProblemDecrypting
		return 0, sslerr.Error()
	}
	return int(outlen), nil
}