Subject: [TLS] SubjectPublicKeyInfo structure in draft-ietf-tls-oob-pubkey

From: "Hannes Tschofenig" <[email-masked]>
Date: Fri, 21 Dec 2012 16:08:12 +0100

Hi all, 

Stefan Jucker, Kovatsch Matthias, and Klaus Hartke pointed out to me that the way how the SubjectPublicKeyInfo structure is placed
in the cerificate payload is not clear. They have provided a figure with three options, which can be found here http://www.tschofenig.priv.at/raw-pk-cert.jpg

The intention was to go for version (c). 

To make this more clear in the current draft version I would therefore suggest to 

a) Add information regarding the encoding of the SubjectPublicKeyInfo structure inside the certificate payload. 

     // Certificate
     opaque ASN.1Cert<1..2^24-1>; 

     // SubjectPublicKeyInfo
     opaque RawPublicKeyCert[Handshake.length];

     struct {
     	select(certificate_type){
     		case X.509-Offer:
     		  ASN.1Cert certificate_list<0..2ˆ24-1>;
     		case RawPublicKey-Offer:      		
              RawPublicKeyCert certificate;
     	};
     } Certificate;

b) Add an example to the appendix. 

For example, the following hex sequence describes a SubjectPublicKeyInfo structure inside the certificate payload:

  0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 
  0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 
  0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xcd, 
  0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 
  0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 
  0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 
  0x2f, 0x90, 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 
  0xa9, 0x9a, 0x40, 0x14, 0x90, 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 
  0xe1, 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 
  0xa1, 0xc1, 0x27, 0x91, 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, 
  0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 
  0x91, 0xf8, 0x61, 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, 0xb7, 
  0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 
  0x37, 0x6d, 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, 0xf2, 0x34, 
  0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 
  0x82, 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, 0x02, 0x03, 0x01, 
  0x00, 0x01

Decoded (for example using Peter's ASN.1 decoder http://www.cs.auckland.ac.nz/~pgut001/) this leads to something like:

Offset  Length   Description
-------------------------------------------------------------------
   0     3+159:   SEQUENCE {
   3      2+13:     SEQUENCE {
   5       2+9:      OBJECT IDENTIFIER Value (1 2 840 113549 1 1 1)
              :             PKCS #1, rsaEncryption
  16       2+0:      NULL
              :      }
  18     3+141:    BIT STRING, encapsulates {
  22     3+137:      SEQUENCE {
  25     3+129:        INTEGER Value (1024 bit)
 157       2+3:        INTEGER Value (65537)
              :        }
              :      }
              :    }
              
Objections?

Ciao
Hannes