kravietz / pam_tacplus

TACACS+ protocol client library and PAM module in C. This PAM module support authentication, authorization (account management) and accounting (session management)performed using TACACS+ protocol designed by Cisco.
GNU Lesser General Public License v3.0
130 stars 97 forks source link

Fix RNG when startup occurred recently #171

Closed BugBaron closed 2 years ago

BugBaron commented 2 years ago

The random number generator function (magic()) uses the 'getrandom()' function. This function relies on the /dev/urandom pool, which may not be initialized when the system has only recently started up. If this function is called before the pool is initialized, then the program will abort.

Added a check for if this case occurs, and in that case the OpenSSL functions are used instead if they are present, otherwise the random() function is used.

gollub commented 2 years ago

LGTM

BugBaron commented 2 years ago

Any idea why the build is failing?

kravietz commented 2 years ago

@BugBaron That was due to SonarCloud job misconfiguration.