Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 371773
Collapse All | Expand All

(-)a/src/crypt.c (-7 / +1 lines)
Lines 41-56 Link Here
41
#include <string.h>
41
#include <string.h>
42
#include <arpa/inet.h>
42
#include <arpa/inet.h>
43
#include "crypt.h"
43
#include "crypt.h"
44
#include "ssl.h"
44
45
45
#ifdef USE_POLARSSL
46
#ifdef USE_POLARSSL
46
#include <polarssl/havege.h>
47
#include <polarssl/havege.h>
47
#define RAND_bytes(_dst_, _size_) do { \
48
	int i; \
49
	for (i = 0; i < _size_; i++) { \
50
	_dst_[i] = havege_rand(&hs); \
51
	} \
52
 } while (0);
53
54
extern havege_state hs;
48
extern havege_state hs;
55
#endif
49
#endif
56
50
(-)a/src/ssl.c (-1 / +1 lines)
Lines 187-193 SSL_handle_t *SSLi_newconnection(int *fd, bool_t *SSLready) Link Here
187
	ssl_set_endpoint(ssl, SSL_IS_SERVER);	
187
	ssl_set_endpoint(ssl, SSL_IS_SERVER);	
188
	ssl_set_authmode(ssl, SSL_VERIFY_NONE);
188
	ssl_set_authmode(ssl, SSL_VERIFY_NONE);
189
189
190
	ssl_set_rng(ssl, havege_rand, &hs);
190
	ssl_set_rng(ssl, HAVEGE_RAND, &hs);
191
	ssl_set_dbg(ssl, pssl_debug, NULL);
191
	ssl_set_dbg(ssl, pssl_debug, NULL);
192
	ssl_set_bio(ssl, net_recv, fd, net_send, fd);
192
	ssl_set_bio(ssl, net_recv, fd, net_send, fd);
193
193
(-)a/src/ssl.h (+21 lines)
Lines 45-52 Link Here
45
#else
45
#else
46
#if (POLARSSL_VERSION_MAJOR == 0)
46
#if (POLARSSL_VERSION_MAJOR == 0)
47
	#define POLARSSL_API_V0
47
	#define POLARSSL_API_V0
48
    #define HAVEGE_RAND (havege_rand)
49
    #define RAND_bytes(_dst_, _size_) do { \
50
	    int i; \
51
	    for (i = 0; i < _size_; i++) { \
52
	        _dst_[i] = havege_rand(&hs); \
53
	    } \
54
    } while (0)
48
#else
55
#else
49
	#define POLARSSL_API_V1
56
	#define POLARSSL_API_V1
57
    #if (POLARSSL_VERSION_MINOR >= 1)
58
        #define HAVEGE_RAND (havege_random)
59
        #define RAND_bytes(_dst_, _size_) do { \
60
	        havege_random(&hs, _dst_, _size_); \
61
		} while (0)
62
    #else
63
        #define HAVEGE_RAND (havege_rand)
64
        #define RAND_bytes(_dst_, _size_) do { \
65
	         int i; \
66
	         for (i = 0; i < _size_; i++) { \
67
	             _dst_[i] = havege_rand(&hs); \
68
	         } \
69
        } while (0)
70
    #endif
50
#endif
71
#endif
51
#endif
72
#endif
52
73

Return to bug 371773