DBA Data[Home] [Help]

FUNCTION: SYS.ORA12C_STRONG_VERIFY_FUNCTION

Source


1 function ora12c_strong_verify_function
2 (username varchar2,
3  password varchar2,
4  old_password varchar2)
5 return boolean IS
6    differ integer;
7 begin
8    if not ora_complexity_check(password, chars => 9, upper => 2, lower => 2,
9                            digit => 2, special => 2) then
10       return(false);
11    end if;
12 
13    -- Check if the password differs from the previous password by at least
14    -- 4 characters
15    if old_password is not null then
16       differ := ora_string_distance(old_password, password);
17       if differ < 4 then
18          raise_application_error(-20032, 'Password should differ from previous '
19                                  || 'password by at least 4 characters');
20       end if;
21    end if;
22 
23    return(true);
24 end;