mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
delegate RSA verify to the RSA module
This commit is contained in:
1 parent
f055e45755
commit
f8816d67c3
6 files changed
+125
-20
No files matched your search
+1
-10
@@ -1704,7 +1704,6 @@ static int mg_tls_verify_cert_signature(const struct mg_tls_cert *cert,
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
uint8_t r;
|
||||
const uint8_t *n;
|
||||
size_t nlen;
|
||||
uint8_t sig2[512]; // 4096 bits
|
||||
@@ -1724,15 +1723,7 @@ static int mg_tls_verify_cert_signature(const struct mg_tls_cert *cert,
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = 0;
|
||||
{
|
||||
const uint8_t *p, *q;
|
||||
size_t i;
|
||||
p = sig2 + nlen - cert->tbshashsz;
|
||||
q = cert->tbshash;
|
||||
for (i = 0; i < cert->tbshashsz; i++) r |= (uint8_t)(*p++ ^ *q++);
|
||||
}
|
||||
return r == 0;
|
||||
return mg_rsa_pkcs_verify(sig2, nlen, cert->tbshash, cert->tbshashsz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user