int ssl_check_clienthello_tlsext_late(SSL *s)
	{
	int ret = SSL_TLSEXT_ERR_OK;
	int al;
	if ((s->tlsext_status_type != -1) && s->ctx && s->ctx->tlsext_status_cb)
		{
		int r;
		CERT_PKEY *certpkey;
		certpkey = ssl_get_server_send_pkey(s);
		if (certpkey == NULL)
			{
			s->tlsext_status_expected = 0;
			return 1;
			}
		s->cert->key = certpkey;
		r = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg);
		switch (r)
			{
			case SSL_TLSEXT_ERR_NOACK:
				s->tlsext_status_expected = 0;
				break;
			case SSL_TLSEXT_ERR_OK:
				if (s->tlsext_ocsp_resp)
					s->tlsext_status_expected = 1;
				else
					s->tlsext_status_expected = 0;
				break;
			case SSL_TLSEXT_ERR_ALERT_FATAL:
				ret = SSL_TLSEXT_ERR_ALERT_FATAL;
				al = SSL_AD_INTERNAL_ERROR;
				goto err;
			}
		}
	else
		s->tlsext_status_expected = 0;
 err:
	switch (ret)
		{
		case SSL_TLSEXT_ERR_ALERT_FATAL:
			ssl3_send_alert(s,SSL3_AL_FATAL,al);
			return -1;
		case SSL_TLSEXT_ERR_ALERT_WARNING:
			ssl3_send_alert(s,SSL3_AL_WARNING,al);
			return 1;
		default:
			return 1;
		}
	}
['int ssl_check_clienthello_tlsext_late(SSL *s)\n\t{\n\tint ret = SSL_TLSEXT_ERR_OK;\n\tint al;\n\tif ((s->tlsext_status_type != -1) && s->ctx && s->ctx->tlsext_status_cb)\n\t\t{\n\t\tint r;\n\t\tCERT_PKEY *certpkey;\n\t\tcertpkey = ssl_get_server_send_pkey(s);\n\t\tif (certpkey == NULL)\n\t\t\t{\n\t\t\ts->tlsext_status_expected = 0;\n\t\t\treturn 1;\n\t\t\t}\n\t\ts->cert->key = certpkey;\n\t\tr = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg);\n\t\tswitch (r)\n\t\t\t{\n\t\t\tcase SSL_TLSEXT_ERR_NOACK:\n\t\t\t\ts->tlsext_status_expected = 0;\n\t\t\t\tbreak;\n\t\t\tcase SSL_TLSEXT_ERR_OK:\n\t\t\t\tif (s->tlsext_ocsp_resp)\n\t\t\t\t\ts->tlsext_status_expected = 1;\n\t\t\t\telse\n\t\t\t\t\ts->tlsext_status_expected = 0;\n\t\t\t\tbreak;\n\t\t\tcase SSL_TLSEXT_ERR_ALERT_FATAL:\n\t\t\t\tret = SSL_TLSEXT_ERR_ALERT_FATAL;\n\t\t\t\tal = SSL_AD_INTERNAL_ERROR;\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\telse\n\t\ts->tlsext_status_expected = 0;\n err:\n\tswitch (ret)\n\t\t{\n\t\tcase SSL_TLSEXT_ERR_ALERT_FATAL:\n\t\t\tssl3_send_alert(s,SSL3_AL_FATAL,al);\n\t\t\treturn -1;\n\t\tcase SSL_TLSEXT_ERR_ALERT_WARNING:\n\t\t\tssl3_send_alert(s,SSL3_AL_WARNING,al);\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn 1;\n\t\t}\n\t}']