tizen 2.1 patch 77/10177/1
authorAnas Nashif <anas.nashif@intel.com>
Mon, 23 Sep 2013 07:49:26 +0000 (03:49 -0400)
committerAnas Nashif <anas.nashif@intel.com>
Mon, 23 Sep 2013 08:25:22 +0000 (04:25 -0400)
Change-Id: I567ca343602cf4230d21cd126b507ebb4d6436d4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
include/xmlsec/keyinfo.h
src/openssl/x509vfy.c

index 5d7cf0e..19dcbb9 100644 (file)
@@ -154,6 +154,10 @@ typedef enum {
  */
 #define XMLSEC_KEYINFO_FLAGS_X509DATA_SKIP_STRICT_CHECKS        0x00004000
 
+
+#define XMLSEC_KEYINFO_FLAGS_ALLOW_BROKEN_CHAIN  0x00008000
+#define XMLSEC_KEYINFO_ERROR_FLAGS_BROKEN_CHAIN  0x00000001
+
 /**
  * xmlSecKeyInfoCtx:
  * @userData:           the pointer to user data (xmlsec and xmlsec-crypto
index fe51da4..b5273a4 100644 (file)
@@ -332,6 +332,10 @@ xmlSecOpenSSLX509StoreVerify(xmlSecKeyDataStorePtr store, XMLSEC_STACK_OF_X509*
             depth       = X509_STORE_CTX_get_error_depth(&xsc);
 
             X509_STORE_CTX_cleanup (&xsc);
+            if(ret != 1 && keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_ALLOW_BROKEN_CHAIN){
+                ret = 1;
+                keyInfoCtx->flags2 |= XMLSEC_KEYINFO_ERROR_FLAGS_BROKEN_CHAIN;
+            }
 
             if(ret == 1) {
                 res = cert;