With some debugging I think the issue I have seen is more of a naming one. Basically there are two attributes for PermissionPolicy: 1. Specification version, which is always hardcoded to "1" for now 2. Serial Number, which could be specified in XML string
Internally, alljoyn_core considers a "version" of a policy to be the Serial Number attribute, instead of Specification version, here are some proof: 1. the "GetPolicyVersion" function in the "alljoyn_core/src/SecurityApplicationProxy.cc" always returns the "Serial Number" field of a policy; 2. Check the "alljoyn_core/src/SecurityApplicationProxy.cc" 95 void XmlPoliciesConverter::BuildPolicy(const XmlElement* root, ajn::PermissionPolicy& policy) 96 { 97 SetPolicyVersion(root->GetChildren()[POLICY_VERSION_INDEX], policy); 98 SetPolicySerialNumber(root->GetChildren()[SERIAL_NUMBER_INDEX], policy); 99 SetPolicyAcls(root->GetChildren()[ACLS_INDEX], policy); 100 } 101 102 void XmlPoliciesConverter::*SetPolicyVersion*(const XmlElement* xmlPolicyVersion, PermissionPolicy& policy) 103 { 104 uint32_t policyVersion = StringToU32(xmlPolicyVersion->GetContent()); 105 policy.*SetSpecificationVersion*(policyVersion); 106 } 107 108 void XmlPoliciesConverter::*SetPolicySerialNumber*(const XmlElement* xmlSerialNumber, PermissionPolicy& policy) 109 { 110 uint32_t serialNumber = StringToU32(xmlSerialNumber->GetContent()); 111 policy.*SetVersion*(serialNumber); 112 } Notice that "SetPolicyVersion" internally calls the "SetSpecificationVersion", but "SetPolicySerialNumber" calls the "SetVersion". However a typical policy XML string looks like this: 103 static AJ_PCSTR s_validNewerPolicy = 104 "<policy>" 105 "<*policyVersion*>1</*policyVersion*>" 106 "<serialNumber>200</serialNumber>" 107 "<acls>" 108 "<acl>" 109 "<peers>" 110 "<peer>" 111 "<type>ALL</type>" 112 "</peer>" 113 "</peers>" 114 VALID_ALLOW_ALL_RULES 115 "</acl>" 116 "</acls>" 117 "</policy>"; And here is our documentation : https://allseenalliance.org/framework/documentation/learn/core/security2_0/hld NameData typeRequiredDescription version number yes The specification version number. The current spec version number is 1. serialNumber number yes The serial number of the policy. The serial number is used to detect of an update to an older policy. ACLs Array of ACLs yes List of access control lists. I think using "policyVersion" tag is some what confusing to new users -- he/she would think GetPolicyVersion returns "1", instead of "200" in this case. I don't think this is a blocking issue. I will file an enhancement bug for 17.04 if I can get a consensus in fixing it. Vincent On Mon, Nov 21, 2016 at 1:18 PM, Josh Spain <jsp...@affinegy.com> wrote: > +Vincent to make sure he's on the email. > > > Josh Spain > Director of Engineering Affinegy, Inc. > t.512-535-1700 x1006 > a. 1705 S Capital of Texas Hwy, Suite 310, Austin, TX 78746 USA > Website <http://affinegy.com> Email <jsp...@affinegy.com> > <http://www.linkedin.com/in/joshspain> <http://twitter.com/affinegy> > Latest Tweet: <https://twitter.com/Affinegy> Mighty Micro-Engines of IoT > - https://t.co/ambxjzUKYE Read More > <https://twitter.com/Affinegy/statuses/799973507090108417> > <https://twitter.com/Affinegy> > > On Mon, Nov 21, 2016 at 1:09 PM, Josh Spain <jsp...@affinegy.com> wrote: > >> Marcello, >> >> When we went through the triage issues we realized that the problem we >> had been discussing was already logged and fixed by Olga. It has already >> been merged into the repository by Way and is awaiting testing by Tyler. >> >> There is another potentially blocking Security 2.0 issue that has been >> found by Vincent. It appears to be in the XML processing, but he is >> investigating and will be logging an issue once he gathers enough >> information. Vincent or I will send out more information when it is >> available. >> >> Thanks, >> Josh >> >> Josh Spain >> Director of Engineering Affinegy, Inc. >> t.512-535-1700 x1006 >> a. 1705 S Capital of Texas Hwy, Suite 310, Austin, TX 78746 USA >> Website <http://affinegy.com> Email <jsp...@affinegy.com> >> <http://www.linkedin.com/in/joshspain> <http://twitter.com/affinegy> >> Latest Tweet: <https://twitter.com/Affinegy> Mighty Micro-Engines of IoT >> - https://t.co/ambxjzUKYE Read More >> <https://twitter.com/Affinegy/statuses/799973507090108417> >> <https://twitter.com/Affinegy> >> > >
_______________________________________________ Alljoyn-core mailing list Alljoyn-core@lists.alljoyn.org https://lists.alljoyn.org/mailman/listinfo/alljoyn-core