summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/src/pk/rsa
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-06-10 23:16:13 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-06-10 23:16:13 +0800
commit4b305c5721f68e39320ca2e15b03a411da2305f1 (patch)
tree5b1698939cf893223f14cec77ed446f28a7d921a /libtomcrypt/src/pk/rsa
parent615885be01188e433cf931e2f7f85394fdc31c5d (diff)
Merge libtomcrypt v1.18.2
Diffstat (limited to 'libtomcrypt/src/pk/rsa')
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_export.c2
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libtomcrypt/src/pk/rsa/rsa_export.c b/libtomcrypt/src/pk/rsa/rsa_export.c
index a9885de..efd61d6 100644
--- a/libtomcrypt/src/pk/rsa/rsa_export.c
+++ b/libtomcrypt/src/pk/rsa/rsa_export.c
@@ -58,7 +58,7 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key
unsigned char* tmp = NULL;
if (type & PK_STD) {
- tmplen = (mp_count_bits(key->N)/8)*2+8;
+ tmplen = (unsigned long)(mp_count_bits(key->N) / 8) * 2 + 8;
tmp = XMALLOC(tmplen);
ptmplen = &tmplen;
if (tmp == NULL) {
diff --git a/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c b/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c
index 8e15e06..0546eb0 100644
--- a/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c
+++ b/libtomcrypt/src/pk/rsa/rsa_import_pkcs8.c
@@ -114,7 +114,7 @@ int rsa_import_pkcs8(const unsigned char *in, unsigned long inlen,
/* check alg oid */
if ((alg_seq[0].size != rsaoid.OIDlen) ||
- XMEMCMP(rsaoid.OID, alg_seq[0].data, rsaoid.OIDlen * sizeof(rsaoid.OID[0]))) {
+ XMEMCMP(rsaoid.OID, alg_seq[0].data, rsaoid.OIDlen * sizeof(rsaoid.OID[0])) != 0) {
err = CRYPT_PK_INVALID_TYPE;
goto LBL_ERR;
}