X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fopenssl%2Frsa.c;h=c3ea692d6235e14662b716e88670aa19c6cdcb2d;hb=027228debee2ea6f31cd176e456c13d626380066;hp=17e8dbaf3d268b004c34adf40e56e4524f488279;hpb=07a560eab66b575f382428a956550817697e25e2;p=meshlink diff --git a/src/openssl/rsa.c b/src/openssl/rsa.c index 17e8dbaf..c3ea692d 100644 --- a/src/openssl/rsa.c +++ b/src/openssl/rsa.c @@ -12,11 +12,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "system.h" @@ -90,3 +88,14 @@ bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) { logger(LOG_ERR, "Unable to perform RSA decryption: %s", ERR_error_string(ERR_get_error(), NULL)); return false; } + +bool rsa_active(rsa_t *rsa) { + return *rsa; +} + +void rsa_free(rsa_t *rsa) { + if(*rsa) { + RSA_free(*rsa); + *rsa = NULL; + } +}