Skip to content

Commit

Permalink
[crypto] Add an explicit "RSA signature incorrect" error message
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 27, 2012
1 parent d45392a commit ed64732
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/crypto/rsa.c
Expand Up @@ -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 };

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit ed64732

Please sign in to comment.