*/
ret->options |= SSL_OP_NO_COMPRESSION;
- ret->tlsext_status_type = -1;
+ ret->tlsext_status_type = TLSEXT_STATUSTYPE_nothing;
return ret;
err:
TLSEXT_IDX_padding
} TLSEXT_INDEX;
+/*
+ * Dummy status type for the status_type extension. Indicates no status type
+ * set
+ */
+#define TLSEXT_STATUSTYPE_nothing -1
+
#define MAX_COMPRESSIONS_SIZE 255
typedef struct {
static int init_status_request(SSL *s, unsigned int context)
{
if (s->server)
- s->tlsext_status_type = -1;
+ s->tlsext_status_type = TLSEXT_STATUSTYPE_nothing;
return 1;
}
* MUST be empty and only sent if we've requested a status
* request message.
*/
- if (s->tlsext_status_type == -1 || PACKET_remaining(pkt) > 0) {
+ if (s->tlsext_status_type == TLSEXT_STATUSTYPE_nothing
+ || PACKET_remaining(pkt) > 0) {
*al = SSL_AD_UNSUPPORTED_EXTENSION;
return 0;
}
/*
* We don't know what to do with any other type so ignore it.
*/
- s->tlsext_status_type = -1;
+ s->tlsext_status_type = TLSEXT_STATUSTYPE_nothing;
return 1;
}
* |tlsext_ocsp_resplen| values will be set if we actually received a status
* message, or NULL and -1 otherwise
*/
- if (s->tlsext_status_type != -1 && s->ctx->tlsext_status_cb != NULL) {
+ if (s->tlsext_status_type != TLSEXT_STATUSTYPE_nothing
+ && s->ctx->tlsext_status_cb != NULL) {
int ret;
ret = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg);
if (ret == 0) {
* and must be called after the cipher has been chosen because this may
* influence which certificate is sent
*/
- if (s->tlsext_status_type != -1 && s->ctx != NULL
+ if (s->tlsext_status_type != TLSEXT_STATUSTYPE_nothing && s->ctx != NULL
&& s->ctx->tlsext_status_cb != NULL) {
int ret;
CERT_PKEY *certpkey = ssl_get_server_send_pkey(s);