提交 d527834a 编写于 作者: A Andy Polyakov

Basic idea behind explicit IV is to make it unpredictable for attacker.

Until now it was xor between CBC residue and 1st block from last datagram,
or in other words still predictable.
上级 89c333e3
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/buffer.h> #include <openssl/buffer.h>
#include <openssl/pqueue.h> #include <openssl/pqueue.h>
#include <openssl/rand.h>
/* mod 128 saturating subtract of two 64-bit values in big-endian order */ /* mod 128 saturating subtract of two 64-bit values in big-endian order */
static int satsub64be(const unsigned char *v1,const unsigned char *v2) static int satsub64be(const unsigned char *v1,const unsigned char *v2)
...@@ -1430,8 +1431,14 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len, ...@@ -1430,8 +1431,14 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len,
/* ssl3_enc can only have an error on read */ /* ssl3_enc can only have an error on read */
wr->length += bs; /* bs != 0 in case of CBC. The enc fn provides if (bs) /* bs != 0 in case of CBC */
* the randomness */ {
RAND_pseudo_bytes(p,bs);
/* master IV and last CBC residue stand for
* the rest of randomness */
wr->length += bs;
}
s->method->ssl3_enc->enc(s,1); s->method->ssl3_enc->enc(s,1);
/* record length after mac and block padding */ /* record length after mac and block padding */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册