diff options
| -rw-r--r-- | crypto/asymmetric_keys/x509_cert_parser.c | 1 | ||||
| -rw-r--r-- | lib/mpi/mpi-pow.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 865f46ea724f..c80765b211cf 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c | |||
| @@ -133,7 +133,6 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen) | |||
| 133 | return cert; | 133 | return cert; |
| 134 | 134 | ||
| 135 | error_decode: | 135 | error_decode: |
| 136 | kfree(cert->pub->key); | ||
| 137 | kfree(ctx); | 136 | kfree(ctx); |
| 138 | error_no_ctx: | 137 | error_no_ctx: |
| 139 | x509_free_certificate(cert); | 138 | x509_free_certificate(cert); |
diff --git a/lib/mpi/mpi-pow.c b/lib/mpi/mpi-pow.c index 5464c8744ea9..e24388a863a7 100644 --- a/lib/mpi/mpi-pow.c +++ b/lib/mpi/mpi-pow.c | |||
| @@ -64,8 +64,13 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) | |||
| 64 | if (!esize) { | 64 | if (!esize) { |
| 65 | /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 | 65 | /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 |
| 66 | * depending on if MOD equals 1. */ | 66 | * depending on if MOD equals 1. */ |
| 67 | rp[0] = 1; | ||
| 68 | res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; | 67 | res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; |
| 68 | if (res->nlimbs) { | ||
| 69 | if (mpi_resize(res, 1) < 0) | ||
| 70 | goto enomem; | ||
| 71 | rp = res->d; | ||
| 72 | rp[0] = 1; | ||
| 73 | } | ||
| 69 | res->sign = 0; | 74 | res->sign = 0; |
| 70 | goto leave; | 75 | goto leave; |
| 71 | } | 76 | } |
