Bug 69771

Summary: crypt may return EPERM and/or EINVAL
Product: Documentation Reporter: KOSAKI Motohiro (kosaki.motohiro)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED CODE_FIX    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Tree: Mainline
Regression: No

Description KOSAKI Motohiro 2014-01-31 19:40:34 UTC
http://man7.org/linux/man-pages/man3/crypt.3.html

crypt(3) man page only has a description about ENOSYS. However current glibc may return EPERM and EINVAL too.
I'd suggest to add following description

EPERM: If /proc/sys/crypto/fips_enabled is turned on and try to use weak crypt type, such as DES.
EINVAL: salt argument has wrong format.


Thanks.
Comment 1 Michael Kerrisk 2014-02-26 16:34:09 UTC
Thanks, for the report Motohiro. I added these texts:

       EINVAL salt has the wrong format.

       EPERM  /proc/sys/crypto/fips_enabled has a nonzero value, and an
              attempt  was  made to use a weak encryption type, such as
              DES.

Okay?

Just for future reports: to help me verify details, pointers to the relevant source files would save me doing some hunting. (I did find them after a little searching, in this case)
Comment 2 KOSAKI Motohiro 2014-02-26 17:02:58 UTC
>Thanks, for the report Motohiro. I added these texts:
>
>       EINVAL salt has the wrong format.
>
>       EPERM  /proc/sys/crypto/fips_enabled has a nonzero value, and an
>              attempt  was  made to use a weak encryption type, such as
>              DES.
>
>Okay?

Yes, thanks.


>Just for future reports: to help me verify details, pointers to the relevant
>>source files would save me doing some hunting. (I did find them after a
>little >searching, in this case)

Oops. Sorry about that. Yes, I'll do that.