Set SSL_SESSION.cipher when parsing.
This was done for the server when parsing a session ticket, but it
wasn't done in the parsing function itself. That caused problems when
high level code used the parsing function directly to set a session for
the client code.
See comments in internal bug 7091840.
Change-Id: Iaa048c3df62cd9fe7a003af33805819e2556960a
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index 2c91053..9f372f9 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -387,8 +387,14 @@
goto err;
}
- ret->cipher=NULL;
ret->cipher_id=id;
+ ret->cipher = ssl3_get_cipher_by_value(ret->cipher_id & 0xffff);
+ if (ret->cipher == NULL)
+ {
+ c.error=SSL_R_UNSUPPORTED_CIPHER;
+ c.line = __LINE__;
+ goto err;
+ }
M_ASN1_D2I_get_x(ASN1_OCTET_STRING,osp,d2i_ASN1_OCTET_STRING);
if ((ssl_version>>8) >= SSL3_VERSION_MAJOR)