Lines Matching defs:serverinfo
763 static int serverinfo_find_extension(const unsigned char *serverinfo,
771 if (serverinfo == NULL || serverinfo_length == 0)
777 /* end of serverinfo */
784 type = (serverinfo[0] << 8) + serverinfo[1];
785 serverinfo += 2;
791 len = (serverinfo[0] << 8) + serverinfo[1];
792 serverinfo += 2;
799 *extension_data = serverinfo;
804 serverinfo += len;
827 const unsigned char *serverinfo = NULL;
830 /* Is there serverinfo data for the chosen server cert? */
831 if ((ssl_get_server_cert_serverinfo(s, &serverinfo,
833 /* Find the relevant extension from the serverinfo */
834 int retval = serverinfo_find_extension(serverinfo, serverinfo_length,
844 return 0; /* No serverinfo data found, don't send
849 * With a NULL context, this function just checks that the serverinfo data
853 static int serverinfo_process_buffer(const unsigned char *serverinfo,
856 if (serverinfo == NULL || serverinfo_length == 0)
862 /* end of serverinfo */
872 ext_type = (serverinfo[0] << 8) + serverinfo[1];
894 serverinfo += 2;
900 len = (serverinfo[0] << 8) + serverinfo[1];
901 serverinfo += 2;
907 serverinfo += len;
912 int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
915 if (ctx == NULL || serverinfo == NULL || serverinfo_length == 0) {
919 if (!serverinfo_process_buffer(serverinfo, serverinfo_length, NULL)) {
931 ctx->cert->key->serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo,
933 if (ctx->cert->key->serverinfo == NULL) {
937 memcpy(ctx->cert->key->serverinfo, serverinfo, serverinfo_length);
941 * Now that the serverinfo is validated and stored, go ahead and
944 if (!serverinfo_process_buffer(serverinfo, serverinfo_length, ctx)) {
954 unsigned char *serverinfo = NULL;
1013 /* Append the decoded extension to the serverinfo buffer */
1014 serverinfo =
1015 OPENSSL_realloc(serverinfo, serverinfo_length + extension_length);
1016 if (serverinfo == NULL) {
1020 memcpy(serverinfo + serverinfo_length, extension, extension_length);
1031 ret = SSL_CTX_use_serverinfo(ctx, serverinfo, serverinfo_length);
1033 /* SSL_CTX_use_serverinfo makes a local copy of the serverinfo. */
1037 OPENSSL_free(serverinfo);