소스 검색

[crypto] Add an explicit "RSA signature incorrect" error message

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 년 전
부모
커밋
ed64732b73
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7
    1
      src/crypto/rsa.c

+ 7
- 1
src/crypto/rsa.c 파일 보기

39
  * RSA is documented in RFC 3447.
39
  * RSA is documented in RFC 3447.
40
  */
40
  */
41
 
41
 
42
+/* Disambiguate the various error causes */
43
+#define EACCES_VERIFY \
44
+	__einfo_error ( EINFO_EACCES_VERIFY )
45
+#define EINFO_EACCES_VERIFY \
46
+	__einfo_uniqify ( EINFO_EACCES, 0x01, "RSA signature incorrect" )
47
+
42
 /** "rsaEncryption" object identifier */
48
 /** "rsaEncryption" object identifier */
43
 static uint8_t oid_rsa_encryption[] = { ASN1_OID_RSAENCRYPTION };
49
 static uint8_t oid_rsa_encryption[] = { ASN1_OID_RSAENCRYPTION };
44
 
50
 
610
 	if ( memcmp ( actual, expected, context->max_len ) != 0 ) {
616
 	if ( memcmp ( actual, expected, context->max_len ) != 0 ) {
611
 		DBGC ( context, "RSA %p signature verification failed\n",
617
 		DBGC ( context, "RSA %p signature verification failed\n",
612
 		       context );
618
 		       context );
613
-		return -EACCES;
619
+		return -EACCES_VERIFY;
614
 	}
620
 	}
615
 
621
 
616
 	DBGC ( context, "RSA %p signature verified successfully\n", context );
622
 	DBGC ( context, "RSA %p signature verified successfully\n", context );

Loading…
취소
저장