-
4
pages
-
English
-
Documents
Description
Universita' di Bologna, II Facolta' di Ingegneria Reti di Calcolatori Materiale didattico: annesso alla Lezione 1y OpenSSL - Tutorial N.B.: questo tutorial e' stato ottenuto per cut-and-paste di materiale contenuto nel sito: http://www.openssl.org/. At first the OpenSSL library must be initialized; see SSL_library_init(3). int SSL_library_init(void); SSL_library_init() initializes the SSL library by registering algorithms (the available ciphers and digests). A typical TLS/SSL application will start with the library initialization, will provide readable error messages and will seed the PRNG. #include #define BUFSIZE . . . char buf[BUFSIZE]; /* inizializza buf */ SSL_load_error_strings(); /* readable error messages */ SSL_library_init(); /* initialize library */ RAND_seed(buf, BUFSIZE); SSL_library_init() only registers ciphers. Another important initialization is the seeding of the PRNG (Pseudo Random Number Generator), which has (may have) to be performed separately. void RAND_seed(const void *buf, int num); RAND_seed() mixes the num bytes at buf into the PRNG state. Thus, if the data at buf are unpredictable to an adversary, this increases the uncertainty about the state and makes the PRNG output less predictable. On systems that provide /dev/urandom, the randomness device is used to seed the PRNG transparently. Then an SSL_CTX object is created as a framework to establish TLS/SSL enabled ...
-
Publié par
-
Langue
English