summaryrefslogtreecommitdiffstats
path: root/crypto/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rsa.c')
-rw-r--r--crypto/rsa.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/crypto/rsa.c b/crypto/rsa.c
index 58aad69a490c..77d737f52147 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -13,6 +13,7 @@
13#include <crypto/internal/rsa.h> 13#include <crypto/internal/rsa.h>
14#include <crypto/internal/akcipher.h> 14#include <crypto/internal/akcipher.h>
15#include <crypto/akcipher.h> 15#include <crypto/akcipher.h>
16#include <crypto/algapi.h>
16 17
17/* 18/*
18 * RSAEP function [RFC3447 sec 5.1.1] 19 * RSAEP function [RFC3447 sec 5.1.1]
@@ -315,11 +316,24 @@ static struct akcipher_alg rsa = {
315 316
316static int rsa_init(void) 317static int rsa_init(void)
317{ 318{
318 return crypto_register_akcipher(&rsa); 319 int err;
320
321 err = crypto_register_akcipher(&rsa);
322 if (err)
323 return err;
324
325 err = crypto_register_template(&rsa_pkcs1pad_tmpl);
326 if (err) {
327 crypto_unregister_akcipher(&rsa);
328 return err;
329 }
330
331 return 0;
319} 332}
320 333
321static void rsa_exit(void) 334static void rsa_exit(void)
322{ 335{
336 crypto_unregister_template(&rsa_pkcs1pad_tmpl);
323 crypto_unregister_akcipher(&rsa); 337 crypto_unregister_akcipher(&rsa);
324} 338}
325 339