File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ S2N_CLEANUP_RESULT s2n_openssl_x509_stack_pop_free(STACK_OF(X509) **cert_chain)
2525 return S2N_RESULT_OK ;
2626}
2727
28- S2N_CLEANUP_RESULT s2n_openssl_asn1_time_free_pointer (ASN1_GENERALIZEDTIME * * time )
28+ S2N_CLEANUP_RESULT s2n_openssl_asn1_time_free_pointer (ASN1_GENERALIZEDTIME * * time_ptr )
2929{
3030 /* The ANS1_*TIME structs are just typedef wrappers around ASN1_STRING
3131 *
@@ -34,8 +34,8 @@ S2N_CLEANUP_RESULT s2n_openssl_asn1_time_free_pointer(ASN1_GENERALIZEDTIME **tim
3434 * ASN1_STRING_free().
3535 * https://www.openssl.org/docs/man1.1.1/man3/ASN1_TIME_to_tm.html
3636 */
37- RESULT_ENSURE_REF (* time );
38- ASN1_STRING_free ((ASN1_STRING * ) * time );
39- * time = NULL ;
37+ RESULT_ENSURE_REF (* time_ptr );
38+ ASN1_STRING_free ((ASN1_STRING * ) * time_ptr );
39+ * time_ptr = NULL ;
4040 return S2N_RESULT_OK ;
4141}
Original file line number Diff line number Diff line change 7272
7373#define ENTROPY_SOURCE "/dev/urandom"
7474
75+ #if defined(O_CLOEXEC )
76+ #define ENTROPY_FLAGS O_RDONLY | O_CLOEXEC
77+ #else
78+ #define ENTROPY_FLAGS O_RDONLY
79+ #endif
80+
7581/* See https://en.wikipedia.org/wiki/CPUID */
7682#define RDRAND_ECX_FLAG 0x40000000
7783
@@ -429,7 +435,7 @@ RAND_METHOD s2n_openssl_rand_method = {
429435static int s2n_rand_init_impl (void )
430436{
431437OPEN :
432- entropy_fd = open (ENTROPY_SOURCE , O_RDONLY | O_CLOEXEC );
438+ entropy_fd = open (ENTROPY_SOURCE , ENTROPY_FLAGS );
433439 if (entropy_fd == -1 ) {
434440 if (errno == EINTR ) {
435441 goto OPEN ;
You can’t perform that action at this time.
0 commit comments