Include self-signed flag in certificates.

Include self-signed flag in certificates by checking SKID/AKID as well as
issuer and subject names. Although this is an incompatible change it should
have little impact in pratice because self-issued certificates that are not
self-signed are rarely encountered.

(Imported from upstream's c00f8d697aed17edbd002e2f6c989d8fbd7c4ecf)
diff --git a/crypto/x509v3/x509v3.h b/crypto/x509v3/x509v3.h
index ecddb0f..4215793 100644
--- a/crypto/x509v3/x509v3.h
+++ b/crypto/x509v3/x509v3.h
@@ -411,7 +411,6 @@
 #define EXFLAG_CA		0x10
 /* Really self issued not necessarily self signed */
 #define EXFLAG_SI		0x20
-#define EXFLAG_SS		0x20
 #define EXFLAG_V1		0x40
 #define EXFLAG_INVALID		0x80
 #define EXFLAG_SET		0x100
@@ -420,6 +419,8 @@
 
 #define EXFLAG_INVALID_POLICY	0x800
 #define EXFLAG_FRESHEST		0x1000
+/* Self signed */
+#define EXFLAG_SS		0x2000
 
 #define KU_DIGITAL_SIGNATURE	0x0080
 #define KU_NON_REPUDIATION	0x0040