Bug 1701 - FIPS-140-2 requires call to RAND_cleanup() before the program using RAND exits
Summary: FIPS-140-2 requires call to RAND_cleanup() before the program using RAND exits
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 5.3p1
Hardware: Other Linux
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-21 23:01 AEDT by jchadima
Modified: 2011-09-25 15:30 AEST (History)
4 users (show)

See Also:


Attachments
Patch solving the problem (521 bytes, patch)
2010-01-21 23:05 AEDT, jchadima
no flags Details | Diff
Alternate patch using cleanup_exit (4.90 KB, patch)
2010-04-06 19:35 AEST, jchadima
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jchadima 2010-01-21 23:01:50 AEDT
There is the mandatory call RAND_cleanup() before the exit of the program that uses RAND for the fips-140-2 compliance.
Comment 1 jchadima 2010-01-21 23:05:10 AEDT
Created attachment 1781 [details]
Patch solving the problem

This is the patch which initilaizing the random device, ensure the call to RAND_cleanup at the exit of the program.
Comment 2 Darren Tucker 2010-03-26 11:37:57 AEDT
Is RAND_cleanup() signal-safe?  (I suspect not, and if it's not then this potentially opens a signal race vulnerability in sshd, which is the reason why all use of atexit was removed from OpenSSH previously.)
Comment 3 Tomas Mraz 2010-04-06 16:47:25 AEST
RAND_cleanup() is not signal safe if the rand generator is supplied by an engine which would be released by the call (no other references than the generator). But this is irrelevant anyway as the functions registered with atexit() are called only in exit() calls and not in the default signal handler termination or in _exit().

If openssh called exit() in signal handler it would be a security problem anyway as this is signal handler unsafe call itself.
Comment 4 jchadima 2010-04-06 19:35:17 AEST
Created attachment 1828 [details]
Alternate patch using cleanup_exit