smriprep icon indicating copy to clipboard operation
smriprep copied to clipboard

Bring ``fips_enabled()`` from fMRIPrep

Open oesteban opened this issue 2 months ago • 0 comments

There's a check in fMRIPrep, under fmriprep.utils.misc, to check if the system is FIPS enabled.

This little function should be the same for all tools using FreeSurfer:

def fips_enabled():
    """
    Check if FIPS is enabled on the system.

    For more information, see:
    https://github.com/nipreps/fmriprep/issues/2480#issuecomment-891199276
    """
    from pathlib import Path

    fips = Path('/proc/sys/crypto/fips_enabled')
    return fips.exists() and fips.read_text()[0] != '0'

oesteban avatar Oct 14 '25 06:10 oesteban