Skip to content

Instantly share code, notes, and snippets.

@errzey
Created November 17, 2010 23:37
Show Gist options
  • Save errzey/704356 to your computer and use it in GitHub Desktop.
Save errzey/704356 to your computer and use it in GitHub Desktop.
if (s->servername_done == 0) {
switch (servname_type) {
case TLSEXT_NAMETYPE_host_name:
if (s->session->tlsext_hostname == NULL) {
if (len > TLSEXT_MAXLEN_host_name ||
((s->session->tlsext_hostname = OPENSSL_malloc(len + 1)) == NULL)) {
*al = TLS1_AD_UNRECOGNIZED_NAME;
return 0;
}
memcpy(s->session->tlsext_hostname, sdata, len);
s->session->tlsext_hostname[len] = '\0';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment