OpenSSL: perform decryption without SSL_read () / SSL_write ()

I wrote a network event library in C, and now I want to add SSL / TLS support through OpenSSL. Instead of using it SSL_read(), SSL_write()I would prefer that OpenSSL only perform encryption / decryption of outgoing / incoming data, allowing me to send / receive data myself.

I am new to SSL / TLS and OpenSSL, therefore:

Is there a way for OpenSSL to only encrypt / decrypt arrays char?

Something like size_t SSL_encrypt(const char *buf_in, size_t size_in, char *buf_out)that would be great.

+5
source share
1 answer

, , , TLS 1--1 - - . , , , SSL , , .

OpenSSL SSL, . , SSL_set_bio() SSL SSL_set_fd():

  • BIO_new_bio_pair(), BIO. BIO SSL, BIO ( , ).

  • SSL_set_bio() SSL, , BIO BIO .

  • BIO_read() BIO_write() BIO SSL.

  • SSL_accept(), SSL_connect(), SSL_read() SSL_write() SSL.

( , : , , OpenSSL, ).

+9

All Articles