summaryrefslogtreecommitdiffstats
path: root/src/crypto/rsa.c
diff options
context:
space:
mode:
authorMichael Brown2012-03-27 15:58:45 +0200
committerMichael Brown2012-03-27 15:58:45 +0200
commited64732b73d604e5209b95d31f2b855b1a4d11f4 (patch)
tree9d9e9d0fb0c2704150e0578cebbc1c84e14c43bb /src/crypto/rsa.c
parent[console] Add LOG_ALL as a synonym for LOG_DEBUG (diff)
downloadipxe-ed64732b73d604e5209b95d31f2b855b1a4d11f4.tar.gz
ipxe-ed64732b73d604e5209b95d31f2b855b1a4d11f4.tar.xz
ipxe-ed64732b73d604e5209b95d31f2b855b1a4d11f4.zip
[crypto] Add an explicit "RSA signature incorrect" error message
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/rsa.c')
-rw-r--r--src/crypto/rsa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/crypto/rsa.c b/src/crypto/rsa.c
index 62f52c95..be2696ba 100644
--- a/src/crypto/rsa.c
+++ b/src/crypto/rsa.c
@@ -39,6 +39,12 @@ FILE_LICENCE ( GPL2_OR_LATER );
* RSA is documented in RFC 3447.
*/
+/* Disambiguate the various error causes */
+#define EACCES_VERIFY \
+ __einfo_error ( EINFO_EACCES_VERIFY )
+#define EINFO_EACCES_VERIFY \
+ __einfo_uniqify ( EINFO_EACCES, 0x01, "RSA signature incorrect" )
+
/** "rsaEncryption" object identifier */
static uint8_t oid_rsa_encryption[] = { ASN1_OID_RSAENCRYPTION };
@@ -610,7 +616,7 @@ static int rsa_verify ( void *ctx, struct digest_algorithm *digest,
if ( memcmp ( actual, expected, context->max_len ) != 0 ) {
DBGC ( context, "RSA %p signature verification failed\n",
context );
- return -EACCES;
+ return -EACCES_VERIFY;
}
DBGC ( context, "RSA %p signature verified successfully\n", context );