summaryrefslogtreecommitdiffstats
path: root/ssl/t1_enc.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2005-04-26 16:02:40 +0000
committerBen Laurie <ben@openssl.org>2005-04-26 16:02:40 +0000
commit36d16f8ee0845d932e250286e8e236580470e35b (patch)
tree3693300e55b12ff86ad08e9c5255ff7b87f88252 /ssl/t1_enc.c
parentab781a0cb6ec7fdd2110103f646aabc29436ae8c (diff)
Add DTLS support.
Diffstat (limited to 'ssl/t1_enc.c')
-rw-r--r--ssl/t1_enc.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index bfcd7d9191..cfcfedaa5d 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -284,7 +284,9 @@ int tls1_change_cipher_state(SSL *s, int which)
if (s->s3->rrec.comp == NULL)
goto err;
}
- memset(&(s->s3->read_sequence[0]),0,8);
+ /* this is done by dtls1_reset_seq_numbers for DTLS1_VERSION */
+ if (s->version != DTLS1_VERSION)
+ memset(&(s->s3->read_sequence[0]),0,8);
mac_secret= &(s->s3->read_mac_secret[0]);
}
else
@@ -313,7 +315,9 @@ int tls1_change_cipher_state(SSL *s, int which)
goto err2;
}
}
- memset(&(s->s3->write_sequence[0]),0,8);
+ /* this is done by dtls1_reset_seq_numbers for DTLS1_VERSION */
+ if (s->version != DTLS1_VERSION)
+ memset(&(s->s3->write_sequence[0]),0,8);
mac_secret= &(s->s3->write_mac_secret[0]);
}
@@ -742,10 +746,13 @@ printf("rec=");
{unsigned int z; for (z=0; z<rec->length; z++) printf("%02X ",buf[z]); printf("\n"); }
#endif
- for (i=7; i>=0; i--)
- {
- ++seq[i];
- if (seq[i] != 0) break;
+ if ( SSL_version(ssl) != DTLS1_VERSION)
+ {
+ for (i=7; i>=0; i--)
+ {
+ ++seq[i];
+ if (seq[i] != 0) break;
+ }
}
#ifdef TLS_DEBUG
@@ -808,6 +815,8 @@ int tls1_alert_code(int code)
case SSL_AD_INTERNAL_ERROR: return(TLS1_AD_INTERNAL_ERROR);
case SSL_AD_USER_CANCELLED: return(TLS1_AD_USER_CANCELLED);
case SSL_AD_NO_RENEGOTIATION: return(TLS1_AD_NO_RENEGOTIATION);
+ case DTLS1_AD_MISSING_HANDSHAKE_MESSAGE: return
+ (DTLS1_AD_MISSING_HANDSHAKE_MESSAGE);
default: return(-1);
}
}