pam_unix: bcrypt option naming discrepancy between shadow-utils and pam

Aperta
#978 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
c

Direzione di ricerca

Start with the pam_unix option handling referenced in modules/pam_unix/support.h, then trace how the module interprets ENCRYPT_METHOD and the blowfish option. Compare the accepted names with the shadow-utils behavior cited in the issue and decide on the compatible naming expected by PAM. Done means bcrypt configuration no longer produces the reported unrecognized-value errors; check or add focused tests for the option handling.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

There seems to be a discrepancy in algoritm naming between PAM and shadow-utils.

pam_unix supports "blowfish":

https://github.com/linux-pam/linux-pam/blob/master/modules/pam_unix/support.h#L141C34-L141C42

while shadow-utils supports "bcrypt", not "blowfish":

https://github.com/shadow-maint/shadow/blob/master/lib/encrypt.c#L49
https://github.com/shadow-maint/shadow/blob/master/src/newusers.c#L434

Configuring bcrypt as the password hash algorithm using the following steps:

  1. Put blowfish in /etc/pam.d/password-auth and /etc/pam.d/system-auth in line containing password sufficient, i.e.:
password    sufficient                                   pam_unix.so blowfish shadow try_first_pass use_authtok

according to pam_unix(8).
2. Put ENCRYPT_METHOD BCRYPT in /etc/login.defs, according to crypt(5).
3. Put crypt_style = blowfish in /etc/libuser.conf, according to libuser.conf(5).
4. Try running any command that uses PAM, e.g. sudo -i.

This leads to error messages such as:

Mar 23 10:36:06 systemd[1846535]: pam_unix(systemd-user:account): unrecognized ENCRYPT_METHOD value [BCRYPT]
...
Mar 23 10:36:07 su[1846533]: pam_unix(su:session): unrecognized ENCRYPT_METHOD value [BCRYPT]
...
Mar 23 10:40:37 sudo[1849297]: pam_unix(sudo-i:account): unrecognized ENCRYPT_METHOD value [BCRYPT]
Mar 23 10:40:37 sudo[1849297]: pam_unix(sudo-i:setcred): unrecognized ENCRYPT_METHOD value [BCRYPT]
Mar 23 10:40:37 sudo[1849297]: pam_unix(sudo-i:session): unrecognized ENCRYPT_METHOD value [BCRYPT]
Mar 23 10:40:37 sudo[1849297]: pam_unix(sudo-i:session): unrecognized ENCRYPT_METHOD value [BCRYPT]
Mar 23 10:40:37 sudo[1849297]: pam_unix(sudo-i:setcred): unrecognized ENCRYPT_METHOD value [BCRYPT]

Now, I'm not sure which needs fixing, shadow-utils or PAM, but it'd be best if they could agree on common naming of this option.

Related issue for shadow-utils: https://github.com/shadow-maint/shadow/issues/1625 .

Lingua principale
C
Stelle
807
Fork
368
Merge medio
6g 16h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linux-pam/linux-pam

Tutte le issue di linux-pam/linux-pam

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.