Subject: [KEYPROV] FW: [pskc] Latest draft of PSKC

From: [email-masked]
Date: Fri, 30 May 2008 11:30:23 -0400

All,
I received some offline comments on the PSKC -03 draft, provided by Rob
Philpott on behalf of folks interested in implementing the key package
format for use with DSKPP.  These comments are reasonable, and IMO,
worth consideration by the group, and so I'm posting them to the list
for discussion. 
Andrea

     1.       Use of xs:ID attributes:

a.       The xs:ID datatype is only used in the DerivedKeyType
complexType.  xs:ID is the preferred mechanism for referring to other
XML elements in an instance document.  So why are custom attributes
defined to be able to refer to elements of the types KeyPropertiesType
(the "KeyPropertiesId" attribute) and KeyType ("KeyId")? Why don't these
use xs:ID attributes?

b.      Why doesn't a KeyContainer have an (optional) ID that could be
used to reference it in an instance document?

c.       Same question for PINPolicy?

d.      The use of the DeviceIdType is inconsistent with other "ID"'s
(that are used for referential information).  The elements in the
DeviceIDType seem more appropriate for the DeviceType or KeyType
elements.  At a minimum, I would not call this a "DeviceIdType" (perhaps
"DeviceInfoType"?) but really, I would just put its elements directly in
the DeviceType complexType).  I would also give <Device> elements an
optional referential ID via xs:ID.

e.      Section 5.2.1 says that the DeviceIdType is an extensible type,
but there are no extension points in it.

2.       We are really unhappy with the proposed extensibility
mechanism. This goes against general XML schema best practice. Defining
extension points via xs:any/xs:anyAttribute is vastly superior (IMO):

a.       The use of "Reserved data attribute names" as described in
section 7 is really difficult to work with. First, <Data> elements
should ONLY be used for "real" extensions... i.e. things that aren't
already known at the time the spec is written.  If we already know that
the items defined in section 7 are needed, they should just be defined
in the schema with their own element/attribute definitions. They should
not be "reserved" uses of the <DATA> element.  We just don't understand
the desire to do it this way. Having explicitly defined elements also
allows for more flexible datayping.

b.      This mechanism only lets us create very simple name-value pair
extensions.  If we have some small groups of related extensions, we'd
really like to be able to define them externally in a private schema via
their own complexType definitions.  With the current method, it's going
to be very messy to add groups of extensions or extensions that have
more complex data values. 

c.       It is also a pain for implementers to deal with the limitation
of the data typing available for unencrypted <Data> elements.  For
example, for a SecurID token with a display interval of 60 seconds, I
cannot simply use an xml schema-defined datatype of xs:integer with a
value of "60".  I have to Base64-encode the big-endian 2-byte binary
value for 60 seconds (and then decode it on the receiving end). Why is
this necessary?  I could define such an item with a single XML element,
but here I need 3 or 4.

d.      This approach does not produce "readable" XML since the data
values are always Base64-encoded.  That is just crazy when the data is
not sensitive in nature.  Please do not underestimate the value of being
able to look at data in an instance document and know what it is without
having to run it through a Base64 decoder! This is a major drawback.

3.       RE: PINPolicy:

a.       If I specify a PINPolicy, I am forced to specify a PINKeyID,
which forces me to create another Key element (even if I don't have any
additional PIN policy info that I need to pass along in that Key
element). For 90% of the use cases, this referential style of
description is overkill and makes the instance document much more
complex than it needs to be.  

b.      The PINPolicy element only contains "policy" attributes for
"WrongPINtry" and "PINUsageMode" and the element is not directly
extensible.  Any extensions we need have to go in Data elements inside a
separate Key element that the PINPolicy then references.  IMO, PIN
policy info should be in the PINPolicy element, not in a separate "Key"
element! The only thing that should go in the Key element is a PIN value
that is being expressly communicated with the instance document.  That
is, a PIN value IS a key; PIN policy information IS NOT a key.

c.       It seems to us that there are additional universally-known PIN
policy attributes that should be included in the schema.  Things such as
the PIN's maximum and minimum length and it's data type (integer,
alphanumeric).  Unless these are part of the spec, we currently are
forced to create custom Data elements for them (and put them in a
referenced Key element). BTW - Just to be clear, I am talking about the
POLICY information associated with whatever PIN a user uses with their
token.  I'm not talking about the attributes of a specific PIN value
that can be expressed in a Key element.  As an example, to express a min
and max PIN length policy, we have to create custom Data elements in a
separate Key element (and also Base64 encode the values).  I'm sorry,
but this is getting ridiculous.  

           <Key KeyId="07552252661"

             KeyAlgorithm="http://www.ietf.org/keyprov/pskc#pin">

              <Data Name="PIN_MIN_LENGTH">

                  <PlainValue>NA==</PlainValue>

              </Data>

              <Data Name="PIN_MAX_LENGTH">

                  <PlainValue>OA==</PlainValue>

              </Data>

           </Key>

Notes:

a.       If I had an xs:any extension point, I could express this in 2
lines of XML in the PinPolicy element.

b.      This example doesn't include the PIN format, which would require
me to either:

                                                                     i.
Use another custom Data element  

                                                                   ii.
Include a ResponseFormat element that then requires inclusion of a
"Length" attribute. But what would the Length attribute really mean in
this case?

d.      Why isn't a PINPolicy reusable across multiple tokens (it has no
ID that can be used in a reference from a token definition).  If I want
to define a PINPolicy that applies to multiple tokens, the PINPolicy
element needs its own ID.

e.      The "WrongPINtry" element name (in PINPolicyType) is not
consistent with the other camel-case names ("try" should be "Try").

f.        In general, it is undesirable to create abbreviations such as
"InAlgo" (in PINUsageMode) to be used as XML keywords. To stay
consistent with "Local" and "Prepend", I would strongly suggest
something like "Embed" or "Algorithmic".

4.       The use of "ResponseFormat" for describing a PIN is very
confusing.  The spec defines ResponseFormat as follows "The
ResponseFormat element defines the characteristics of the result of a
computation.  This defines the format of the OTP or of the response to a
challenge." A PIN is not the result of a "computation", nor is it a
response to a challenge.  It seems quite odd to use this Key construct
for a PIN. I think that either another usage type should be defined or
the ResponseFormat definition should be changed to also reflect its use
for describing a PIN.

_______________________________________________
KEYPROV mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/keyprov

---

From: [email-masked]
Date: Fri, 30 May 2008 11:35:44 -0400

Here is Philip Hoyer's response to Rob's comments (see below), which we
initially handled offline, and then we decided it would be better to
further the discussion on the mailing list.  
-- Andrea

defined to be able to referto elements of the types KeyPropertiesType

[PH] good point I was thinking that xs:Id for KeyPropertiesId could be a
good choice  The KeyId on the other hand is not really used to be
referred to. Do you think it would be better to use xs:ID for this
aswell? And in case we use it now is it backwards compatible to what we
have? 

[PH] valid comment and I will think we should add this 

[PH] agreed

[PH] so basically you are saying that any high level entity (Key,
Device, KeyContainer etc) should have an ID that is xs:ID? The thought
of DeviceId was to aggregate under a specific type the elements that
comprise the compound key to look up the device

[PH] agreed I think we should add an xs:any

[PH] this has been extensively discussed at IETF and there are pros and
cons for all approaches. The pro's of the name value approach is that it
will be re-usable for the ASN.1 spec and that we will have a semantic
registry defined by IANA.

[PH] this has been extensively discussed. And we opted for the name
value pair approach. This mean that all elements in Data can be parsed
in the same manner and individually be encrypted or not. There will be a
centralized semantic registry by IANA, etc

[PH] why do you say that, the name could be also be a namespace for an
wholly encrypted or base64 encoded XML sub node. I see your point though
in terms of parsing here. Could you give me an example of what you had
in mind since we have considered quite a few use cases and not come
across the requirement for grouped extensions.

[PH] using xs:string for plainvalue was discussed during the last IETF
meeting (I personally am in favor of it) but Sean Turner and the rest of
the people did not see much value in it. If we use string we will need
to deice for specific data elements what the encoding rules are. For
example do we say for 8 byte unsigned int to encode just string e.g.
'60' or leading 0 examples '00000060'. I would appreciate your thoughts
on this. Also how would we encode binary data in string form base64
encoded?

[PH] agreed and see answer above

3.       RE: PINPolicy:

[PH] if you are referring to the fact that '<xs:attribute
name="PINKeyId" type="xs:string" use="required"/>' is set to required I
agree with you. We should set this to 'optional'. I do not agree with
your 90% use case analysis since the main use cases I have come across
where to transmit the initial random pin for PINPads tokens within the
same PSKC document from manufacturing to the validation server.

[PH] I agree we need to make PINPolicy extensible and not put stuff into
the Data elements of the PINKey. Are there any other elements that you
know of we should include now and not just as an xs:any extension?

           <Key KeyId="07552252661"

              </Data>

              </Data>

           </Key>

[PH] no the format and length would be in the UsageElement of the
PINKey. I had hoped Example (Section 12.2 of the spec) would make that
clear here is the XML fragment:

       <Key KeyId="07552252661" 

            <Usage>

                <ResponseFormat Length="4" Format="DECIMAL"/>

            </Usage>

            <Data Name="SECRET">

                <PlainValue>MTIzNA==</PlainValue>

            </Data>

        </Key>

Notes:

                                                                     i.

                                                                   ii.

[PH] I see your point. If we make PINKeyId optional as in the comment
above you can have a common PINPolicy as part of the shared
KeyProperties. I believe that would serve your purpose.

[PH] agreed, will change

f.        In general, it is undesirable to create abbreviations such as
"InAlgo" (in PINUsageMode) to be used as XML keywords. To stay
consistent with "Local" and "Prepend", I would strongly suggest
something like "Embed" or "Algorithmic".
[PH[ we had Embed before and people got confused by the meaning. So
maybe Algorithmic is a better choice, that is why I tried to express the
use of the PIN in the algorithm as InAlgo. I do not feel very strong
about it. Maybe we can have a vote

4.       The use of "ResponseFormat" for describing a PIN is very
confusing.  The spec defines ResponseFormat as follows "The
ResponseFormat element defines the characteristics of the result of a
computation.  This defines the format of the OTP or of the response to a
challenge." A PIN is not the result of a "computation", nor is it a
response to a challenge.  It seems quite odd to use this Key construct
for a PIN. I think that either another usage type should be defined or
the ResponseFormat definition should be changed to also reflect its use
for describing a PIN.
[PH] Yes I think we need to change the description. I am getting a lot
of push back to include PIN requirements in the spec so I tried to
convince people that tit was a good idea without having to introduce to
many new schema types. Here you say it is odd to use the Key element for
the PIN value but above you agree that a PIN IS a Key. So I would keep
it in the Key element buy change description.