> On Saturday, 22 February 2020, 07:58:10 GMT, 放下 via vala-list 
> <[email protected]> wrote: 
> if set the instance_pos as 2.1, the code can compile and will crashed at 
> function public_encrypt / private_decrypt,

2.1 sounds about right. That may not be the cause of the crash.

The documentation is helpful: 
https://www.openssl.org/docs/man1.1.1/man3/RSA_public_encrypt.html

`flen` should be the size of `from`. So you should use `array_length_pos` with 
`from` instead of `array_length = false`.

For improved code readability you can make `padding` a Vala enum called 
`Padding` that binds `RSA_PKCS1_PADDING`, etc.

A useful tip is to look at the C code generated from the Vala. Use `--ccode` or 
`--save-temps` with valac to get the intermediate C files. If you still have 
troubles please post the intermediate C code generated from Vala.

Best wishes,

Al
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to