Commit cbb09544 authored by Matt Caswell's avatar Matt Caswell
Browse files

Introduce TLSEXT_STATUSTYPE_nothing constant



The existing code used the magic number -1 to represent the absence of
a status_type in the extension. This commit replaces it with a macro.

Perl changes reviewed by Richard Levitte. Non-perl changes reviewed by Rich
Salz

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent d270de32
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2556,7 +2556,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
     */
    ret->options |= SSL_OP_NO_COMPRESSION;

    ret->tlsext_status_type = -1;
    ret->tlsext_status_type = TLSEXT_STATUSTYPE_nothing;

    return ret;
 err:
+6 −0
Original line number Diff line number Diff line
@@ -1671,6 +1671,12 @@ typedef enum tlsext_index_en {
    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 {
+1 −1
Original line number Diff line number Diff line
@@ -764,7 +764,7 @@ static int init_session_ticket(SSL *s, unsigned int context)
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;
}
+2 −1
Original line number Diff line number Diff line
@@ -754,7 +754,8 @@ int tls_parse_stoc_status_request(SSL *s, PACKET *pkt, int *al)
     * 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;
    }
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ int tls_parse_ctos_status_request(SSL *s, PACKET *pkt, int *al)
        /*
         * 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;
    }

Loading