Lines Matching defs:serverinfo
744 static int serverinfo_find_extension(const unsigned char *serverinfo,
752 if (serverinfo == NULL || serverinfo_length == 0)
758 /* end of serverinfo */
765 type = (serverinfo[0] << 8) + serverinfo[1];
766 serverinfo += 2;
772 len = (serverinfo[0] << 8) + serverinfo[1];
773 serverinfo += 2;
780 *extension_data = serverinfo;
785 serverinfo += len;
808 const unsigned char *serverinfo = NULL;
811 /* Is there serverinfo data for the chosen server cert? */
812 if ((ssl_get_server_cert_serverinfo(s, &serverinfo,
814 /* Find the relevant extension from the serverinfo */
815 int retval = serverinfo_find_extension(serverinfo, serverinfo_length,
823 return -1; /* No serverinfo data found, don't send
828 * With a NULL context, this function just checks that the serverinfo data
832 static int serverinfo_process_buffer(const unsigned char *serverinfo,
835 if (serverinfo == NULL || serverinfo_length == 0)
841 /* end of serverinfo */
851 ext_type = (serverinfo[0] << 8) + serverinfo[1];
859 serverinfo += 2;
865 len = (serverinfo[0] << 8) + serverinfo[1];
866 serverinfo += 2;
872 serverinfo += len;
877 int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
880 if (ctx == NULL || serverinfo == NULL || serverinfo_length == 0) {
884 if (!serverinfo_process_buffer(serverinfo, serverinfo_length, NULL)) {
896 ctx->cert->key->serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo,
898 if (ctx->cert->key->serverinfo == NULL) {
902 memcpy(ctx->cert->key->serverinfo, serverinfo, serverinfo_length);
906 * Now that the serverinfo is validated and stored, go ahead and
909 if (!serverinfo_process_buffer(serverinfo, serverinfo_length, ctx)) {
919 unsigned char *serverinfo = NULL;
978 /* Append the decoded extension to the serverinfo buffer */
979 serverinfo =
980 OPENSSL_realloc(serverinfo, serverinfo_length + extension_length);
981 if (serverinfo == NULL) {
985 memcpy(serverinfo + serverinfo_length, extension, extension_length);
996 ret = SSL_CTX_use_serverinfo(ctx, serverinfo, serverinfo_length);
998 /* SSL_CTX_use_serverinfo makes a local copy of the serverinfo. */
1002 OPENSSL_free(serverinfo);