예제 #1
0
 def on_submit_master(self, master):
   print "submit master"
   self.asked_for_master = False
   if self.no_saved_master:
     hashpasslib.store_master(master)
     self.no_saved_master = False
     self.ask_for_master("Enter the password again.")
   else:
     if hashpasslib.is_correct_master(master):
       hashpasslib.use_master(master, use_bcrypt=True)
       self.ask_for_website()
     else:
       self.ask_for_master("That didn't match your saved master. ")
예제 #2
0
 def on_submit_master(self, master):
     print "submit master"
     self.asked_for_master = False
     if self.no_saved_master:
         hashpasslib.store_master(master)
         self.no_saved_master = False
         self.ask_for_master("Enter the password again.")
     else:
         if hashpasslib.is_correct_master(master):
             hashpasslib.use_master(master, use_bcrypt=True)
             self.ask_for_website()
         else:
             self.ask_for_master("That didn't match your saved master. ")
예제 #3
0
def get_master_gui(use_bcrypt):
    """Gets the password via pinentry.

    Calls use_master if it works, otherwise does nothing.

    Returns: None
    """
    try:
        pw = pinentry.get_pin(description="Enter hashpass master password:"******"Password:"******"User canceled password entry.")
                return None
            pw = pinentry.get_pin(description="Enter hashpass master password:"******"Password:"******"That doesn't match the stored master.")
        hashpasslib.use_master(pw, use_bcrypt)
    except pinentry.PinEntryException:
        logging.critical("Cannot use pinentry.")
        sys.exit(-1)
        return None
예제 #4
0
def get_master_gui(use_bcrypt):
    """Gets the password via pinentry.

    Calls use_master if it works, otherwise does nothing.

    Returns: None
    """
    try:
        pw = pinentry.get_pin(description="Enter hashpass master password:"******"Password:"******"User canceled password entry.")
                return None
            pw = pinentry.get_pin(
                description="Enter hashpass master password:"******"Password:"******"That doesn't match the stored master.")
        hashpasslib.use_master(pw, use_bcrypt)
    except pinentry.PinEntryException:
        logging.critical("Cannot use pinentry.")
        sys.exit(-1)
        return None