Changeset 689

Show
Ignore:
Timestamp:
19/08/08 12:42:16 (5 months ago)
Author:
smoku
Message:

Do not offer compression if STARTTLS is required and not enabled. Return better error on STARTTLS required failure.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/c2s/c2s.c

    r672 r689  
    408408                log_write(sess->c2s->log, LOG_NOTICE, "[%d] got pre STARTTLS packet, dropping", sess->s->tag); 
    409409 
    410                 sx_error(s, stream_err_NOT_AUTHORIZED, "stanza sent before starttls"); 
     410                sx_error(s, stream_err_POLICY_VIOLATION, "STARTTLS is required for this stream"); 
    411411 
    412412                nad_free(nad); 
  • trunk/sx/compress.c

    r672 r689  
    120120    int ns; 
    121121 
    122     /* if the session is already compressed, or the app told us not to, then we don't offer anything */ 
    123     if(s->compressed || !(s->flags & SX_COMPRESS_OFFER)) 
     122    /* if the session is already compressed, or the app told us not to, 
     123         * or STARTTLS is required and stream is not encrypted yet, then we don't offer anything */ 
     124    if(s->compressed || !(s->flags & SX_COMPRESS_OFFER) || ((s->flags & SX_SSL_STARTTLS_REQUIRE) && s->ssf == 0)) 
    124125        return; 
    125126