Do the passwords match?
19325
public function passwords($pass1, $pass2, $id) {
        if ($pass1 !== $pass2) {
            $this->add($id, 'The passwords you entered do not match.');
            return false;
        }

        return true;
    }
225765
def handle_get_passphrase(self, conn, _):
        """"""
        p1 = self.client.device.ui.get_passphrase('Symmetric encryption:')
        p2 = self.client.device.ui.get_passphrase('Re-enter encryption:')
        if p1 == p2:
            result = b'D ' + util.assuan_serialize(p1.encode('ascii'))
            keyring.sendline(conn, result, confidential=True)
        else:
            log.warning('Passphrase does not match!')
609640
def save_password(self, password, **attrs):
        
        pos_of_match = self._match_exists(attrs['searchable'])
        if pos_of_match:
            old_password = self.get_password(pos_of_match).get_secret()
            gkr.item_delete_sync(self.keyring, pos_of_match)
            desc = str(int(time.time())) + "_" + attrs['searchable']
            gkr.item_create_sync(self.keyring
                                ,gkr.ITEM_GENERIC_SECRET
                                ,desc
                                ,{}
                                ,old_password
                                ,True)
        desc = attrs['searchable']
        pos = gkr.item_create_sync(self.keyring
                                   ,gkr.ITEM_GENERIC_SECRET
                                   ,desc
                                   ,attrs
                                   ,password
                                   ,True)
        return pos
888796
def CheckPasswordReuse(skipUserInput):
  
  goodlogging.Log.Info("EXTRACT", "RAR files needs password to extract")
  if skipUserInput is False:
    prompt = "Enter 't' to reuse the last password for just this file, " \
             "'a' to reuse for all subsequent files, " \
             "'n' to enter a new password for this file " \
             "or 's' to enter a new password for all files: "
    response = goodlogging.Log.Input("EXTRACT", prompt)
    response = util.ValidUserResponse(response, ('t','a','n','s'))
  else:
    response = 'a'

  if response.lower() == 's':
    return -1
  if response.lower() == 'n':
    return 0
  elif response.lower() == 't':
    return 1
  elif response.lower() == 'a':
    return 2
782793
def __get_password(self, description='',
                       confirm=False, clear=False, username='glances'):
        
        from glances.password import GlancesPassword
        password = GlancesPassword(username=username)
        return password.get_password(description, confirm, clear)
220039
def prompt_and_confirm_password(self, message):
        
        while True:
            pwd = self.input_password(message)
            cpwd = self.input_password("Confirm password")
            if pwd == cpwd:
                return pwd
            else:
                self.__screen.cprintln("Passwords do not match.")
1366017
def clean(self):
        ''''''
        data = super(PasswordMixin, self).clean()
        if 'password' in data and 'confirm_password' in data:
            if data['password'] != data['confirm_password']:
                raise ValidationError(_('Passwords do not match.'))
        return data
664106
def check_password(password)
    return false unless key
    key == self.class.hash_password(password, key.split('|', 2).first)
  end
808999
def check_auth(self, username, password):
        """"""
        if username == self.args.username:
            from glances.password import GlancesPassword
            pwd = GlancesPassword()
            return pwd.check_password(self.args.password, pwd.sha256_hash(password))
        else:
            return False
266917
def check_password(password: str, encrypted: str) -> bool:
    
    # some old passwords have {crypt} in lower case, and passlib wants it to be
    # in upper case.
    if encrypted.startswith("{crypt}"):
        encrypted = "{CRYPT}" + encrypted[7:]
    return pwd_context.verify(password, encrypted)
996316
def validate_password2(self, value):
        
        if value != self.initial_data['password1']:
            raise serializers.ValidationError(_('Password confirmation mismatch'))
        return value
409333
private static ArrayList<DateMatch> matchDatesWithSeparator(Configuration configuration, String password)
    {

        // Initialize the list of matching dates
        ArrayList<DateMatch> dateMatches = new ArrayList<>();

        // Create all possible subsequences of the password
        for (int start = 0; start < password.length(); start++)
        {
            for (int end = start + 6; end <= password.length(); end++)
            {

                // Get the subsequence
                String passwordChunk = password.substring(start, end);

                // Extract the date (if there is one) with the year as prefix
                Matcher m1 = DATE_WITH_SEPARATOR_YEAR_SUFFIX.matcher(passwordChunk);
                if (m1.matches())
                {
                    ValidDateSplit split = isDateValid(m1.group(1), m1.group(3), m1.group(4));
                    if (split != null)
                    {
                        dateMatches.add(new DateMatch(passwordChunk, configuration, split.date, split.month, split.year, m1.group(2), start, end - 1));
                    }
                }

                // Extract the date (if there is one) with the year as suffix
                Matcher m2 = DATE_WITH_SEPARATOR_YEAR_PREFIX.matcher(passwordChunk);
                if (m2.matches())
                {
                    ValidDateSplit split = isDateValid(m2.group(4), m2.group(3), m2.group(1));
                    if (split != null)
                    {
                        dateMatches.add(new DateMatch(passwordChunk, configuration, split.date, split.month, split.year, m2.group(2), start, end - 1));
                    }
                }

            }
        }

        return dateMatches;

    }
328050
def __password(self):
        """"""
        passwd = copy(self._inp_password.value)
        self._inp_password.value = ''
        return passwd
980151
private static char[] getPassword(TextDevice textDevice, String key) {
        boolean noMatch;
        char[] cred = new char[0];
        char[] passwd1;
        char[] passwd2;
        do {
            passwd1 = textDevice.readPassword("Please enter the password value for %s:", key);
            passwd2 = textDevice.readPassword("Please enter the password value for %s again:", key);
            noMatch = !Arrays.equals(passwd1, passwd2);
            if (noMatch) {
                if (passwd1 != null) {
                    Arrays.fill(passwd1, ' ');
                }
                textDevice.printf("Password entries don't match. Please try again.\n");
            } else {
                if (passwd1.length == 0) {
                    textDevice.printf("An empty password is not valid.  Please try again.\n");
                    noMatch = true;
                } else {
                    cred = passwd1;
                }
            }
            if (passwd2 != null) {
                Arrays.fill(passwd2, ' ');
            }
        } while (noMatch);
        return cred;
    }
649089
def is_valid_password(password):
    
    pattern = re.compile(r"^.{4,25}$")
    return password and pattern.match(password)
1048226
private static ArrayList<DateMatch> matchDatesWithoutSeparator(Configuration configuration, String password)
    {

        // Initialize the list of matching dates
        ArrayList<DateMatch> dateMatches = new ArrayList<>();

        // Create all possible subsequences of the password
        for (int start = 0; start < password.length(); start++)
        {
            for (int end = start + 4; end <= password.length(); end++)
            {

                // Get the subsequence
                String passwordChunk = password.substring(start, end);

                // Quick verfication that it is made of numbers
                if (DATE_WITHOUT_SEPARATOR.matcher(passwordChunk).find())
                {

                    // Extract the possible combinaison of dateAndMonth/year from the
                    // subsequence (eg: 121234 => 1212/34 and 12/1234)
                    ArrayList<PartialDateSplit> possiblePartialSplit = new ArrayList<>();
                    int chunkLength = passwordChunk.length();
                    if (chunkLength <= 6)
                    {
                        // start with a 2 digits year
                        possiblePartialSplit.add(new PartialDateSplit(
                                passwordChunk.substring(2),
                                passwordChunk.substring(0, 2)
                        ));
                        // end with a 2 digits year
                        possiblePartialSplit.add(new PartialDateSplit(
                                passwordChunk.substring(0, chunkLength - 2),
                                passwordChunk.substring(chunkLength - 2, chunkLength)
                        ));
                    }
                    if (chunkLength >= 6)
                    {
                        // start with a 4 digits year
                        possiblePartialSplit.add(new PartialDateSplit(
                                passwordChunk.substring(4),
                                passwordChunk.substring(0, 4)
                        ));
                        // end with a 4 digits year
                        possiblePartialSplit.add(new PartialDateSplit(
                                passwordChunk.substring(0, chunkLength - 4),
                                passwordChunk.substring(chunkLength - 4, chunkLength)
                        ));
                    }

                    // For each dateAndMonth/year extract the different possible full date
                    // (eg: 123/1998 => 1/23/1998 and 12/3/1998)
                    ArrayList<FullDateSplit> possibleFullSplit = new ArrayList<>();
                    for (PartialDateSplit split : possiblePartialSplit)
                    {
                        int dateAndMonthLength = split.dateAndMonth.length();
                        if (dateAndMonthLength == 2)
                        {
                            possibleFullSplit.add(new FullDateSplit(
                                    split.dateAndMonth.substring(0, 1),
                                    split.dateAndMonth.substring(1, 2),
                                    split.year
                            ));
                        }
                        else if (dateAndMonthLength == 3)
                        {
                            possibleFullSplit.add(new FullDateSplit(
                                    split.dateAndMonth.substring(0, 1),
                                    split.dateAndMonth.substring(1, 3),
                                    split.year
                            ));
                            possibleFullSplit.add(new FullDateSplit(
                                    split.dateAndMonth.substring(0, 2),
                                    split.dateAndMonth.substring(2, 3),
                                    split.year
                            ));
                        }
                        else if (dateAndMonthLength == 4)
                        {
                            possibleFullSplit.add(new FullDateSplit(
                                    split.dateAndMonth.substring(0, 2),
                                    split.dateAndMonth.substring(2, 4),
                                    split.year
                            ));
                        }
                    }

                    // Add to the final date list all the valid dates
                    for (FullDateSplit split : possibleFullSplit)
                    {
                        ValidDateSplit vSplit = isDateValid(split.date, split.month, split.year);
                        if (vSplit != null)
                        {
                            dateMatches.add(new DateMatch(passwordChunk, configuration, vSplit.date, vSplit.month, vSplit.year, "", start, end - 1));
                        }
                    }

                }
            }
        }

        return dateMatches;

    }
894656
def is_password(self, is_password):
        

        if is_password:
            self.is_forgetable = True

        self._is_password = is_password