Fix d2i_SSL_SESSION.
authorBodo Möller <bodo@openssl.org>
Mon, 5 Sep 2011 13:31:07 +0000 (13:31 +0000)
committerBodo Möller <bodo@openssl.org>
Mon, 5 Sep 2011 13:31:07 +0000 (13:31 +0000)
CHANGES
ssl/ssl.h
ssl/ssl_asn1.c

diff --git a/CHANGES b/CHANGES
index 475d9ae2ebad1f075e974116d722d8e23cca0f60..4612a7fcb338b107cfea0bd3b51ef728009e6fa2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
 
  Changes between 1.0.0e and 1.0.1  [xx XXX xxxx]
 
+  *) Fix PSK session representation.
+     [Bodo Moeller]
+
   *) Add RC4-MD5 and AESNI-SHA1 "stitched" implementations.
 
      This work was sponsored by Intel.
index 11ed467452e9bebeb413bc2458fe324e683af10e..8082da728f12b2ac674f67872865a41c411c9fee 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -447,10 +447,12 @@ struct ssl_method_st
  *     Session_ID_context [ 4 ] EXPLICIT OCTET STRING,   -- the Session ID context
  *     Verify_result [ 5 ] EXPLICIT INTEGER,   -- X509_V_... code for `Peer'
  *     HostName [ 6 ] EXPLICIT OCTET STRING,   -- optional HostName from servername TLS extension 
- *     ECPointFormatList [ 7 ] OCTET STRING,     -- optional EC point format list from TLS extension
- *     PSK_identity_hint [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
- *     PSK_identity [ 9 ] EXPLICIT OCTET STRING -- optional PSK identity
- *     SRP_username [ 11 ] EXPLICIT OCTET STRING -- optional SRP username
+ *     PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
+ *     PSK_identity [ 8 ] EXPLICIT OCTET STRING,  -- optional PSK identity
+ *     Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket
+ *     Ticket [10]             EXPLICIT OCTET STRING, -- session ticket (clients only)
+ *     Compression_meth [11]   EXPLICIT OCTET STRING, -- optional compression method
+ *     SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username
  *     }
  * Look in ssl/ssl_asn1.c for more details
  * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
index 994a654edbbe80305b3555df4064b8a11f82e9fd..9fd3535ca606f9b3c302747afe1607cebd88fd31 100644 (file)
@@ -571,6 +571,19 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
                }
        else
                ret->psk_identity_hint=NULL;
+
+       os.length=0;
+       os.data=NULL;
+       M_ASN1_D2I_get_EXP_opt(osp,d2i_ASN1_OCTET_STRING,8);
+       if (os.data)
+               {
+               ret->psk_identity = BUF_strndup((char *)os.data, os.length);
+               OPENSSL_free(os.data);
+               os.data = NULL;
+               os.length = 0;
+               }
+       else
+               ret->psk_identity=NULL;
 #endif /* OPENSSL_NO_PSK */
 
 #ifndef OPENSSL_NO_TLSEXT