MCPcopy Create free account
hub / github.com/foxcpp/maddy / IsPasswordValid

Method IsPasswordValid

internal/auth/shadow/verify.go:42–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (e *Entry) IsPasswordValid() bool {
43 if e.LastChange == -1 || e.MaxPassAge == -1 || e.InactivityPeriod == -1 {
44 return true
45 }
46
47 nowDays := int(time.Now().Unix() / secsInDay)
48 return nowDays < e.LastChange+e.MaxPassAge+e.InactivityPeriod
49}
50
51func (e *Entry) VerifyPassword(pass string) (err error) {
52 // Do not permit null and locked passwords.

Callers 2

AuthPlainMethod · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected