src/etpan_mime.c
changeset 438 106b9765559d
parent 165 f0894860af4a
child 747 d357dceebec6
     1.1 --- a/src/etpan_mime.c	Sat Jan 30 10:34:26 2016 +0100
     1.2 +++ b/src/etpan_mime.c	Sat Jan 30 11:20:54 2016 +0100
     1.3 @@ -10,22 +10,17 @@
     1.4  #include <assert.h>
     1.5  #include <errno.h>
     1.6  
     1.7 -#define MAX_MESSAGE_ID 512
     1.8 +#define MAX_MESSAGE_ID 128
     1.9  
    1.10  static char * generate_boundary(void)
    1.11  {
    1.12      char id[MAX_MESSAGE_ID];
    1.13 -    long value1;
    1.14 -    long value2;
    1.15 -    long value3;
    1.16 -    long value4;
    1.17 - 
    1.18 -    // no random needed here
    1.19  
    1.20 -    value1 = random();
    1.21 -    value2 = random();
    1.22 -    value3 = random();
    1.23 -    value4 = random();
    1.24 +    // no cryptographically strong random needed here
    1.25 +    const long value1 = random();
    1.26 +    const long value2 = random();
    1.27 +    const long value3 = random();
    1.28 +    const long value4 = random();
    1.29  
    1.30      snprintf(id, MAX_MESSAGE_ID, "%.4lx%.4lx%.4lx%.4lx", value1, value2,
    1.31              value3, value4);