Exemple #1
0
def luks_add_key(device,
                 new_passphrase=None,
                 passphrase=None, key_file=None):
    # pylint: disable=unused-argument
    if not passphrase:
        raise ValueError("luks_add_key requires passphrase")

    cs = CryptSetup(device=device, yesDialog=yesDialog, logFunc=logFunc, passwordDialog=passwordDialog)
    rc = cs.addKeyByPassphrase(passphrase=passphrase, newPassphrase=new_passphrase)

    if rc<0:
        raise CryptoError("luks add key failed with errcode %d" % (rc,))
Exemple #2
0
def luks_add_key(device,
                 new_passphrase=None,
                 passphrase=None, key_file=None):

    if not passphrase:
        raise ValueError("luks_add_key requires passphrase")

    cs = CryptSetup(device=device, yesDialog=askyes, logFunc=dolog, passwordDialog=askpassphrase)
    rc = cs.addKeyByPassphrase(passphrase=passphrase, newPassphrase=new_passphrase)

    if rc<0:
        raise CryptoError("luks add key failed with errcode %d" % (rc,))
Exemple #3
0
def luks_add_key(device, new_passphrase, passphrase, key_file=None):
    """
    Add passphrase to a LUKS device.

    :param str device: device idenfitier
    :param str new_passphrase: new passphrase to assign
    :param str passphrase: authenticate with current passphrase
    :param str key_file: authenticate with this key file
    :returns: 0 on success
    """
    cs = CryptSetup(device=device, yesDialog=yesDialog, logFunc=logFunc)
    return cs.addKeyByPassphrase(passphrase=passphrase,
                                 newPassphrase=new_passphrase)
Exemple #4
0
def luks_add_key(device, new_passphrase=None, passphrase=None, key_file=None):
    # pylint: disable=unused-argument
    if not passphrase:
        raise ValueError("luks_add_key requires passphrase")

    cs = CryptSetup(device=device,
                    yesDialog=yesDialog,
                    logFunc=logFunc,
                    passwordDialog=passwordDialog)
    rc = cs.addKeyByPassphrase(passphrase=passphrase,
                               newPassphrase=new_passphrase)

    if rc < 0:
        raise CryptoError("luks add key failed with errcode %d" % (rc, ))
Exemple #5
0
def luks_add_key(device, new_passphrase, passphrase, key_file=None):
    cs = CryptSetup(device=device, yesDialog=yesDialog, logFunc=logFunc, passwordDialog=passwordDialog)
    return cs.addKeyByPassphrase(passphrase=passphrase, newPassphrase=new_passphrase)