iv = y[:me.c.__class__.blksz]
if me.c.__class__.blksz: me.c.setiv(iv)
return me.c.decrypt(y[me.c.__class__.blksz:])
-
+
class PPK (Crypto):
def __init__(me, pp, c, h, m, salt = None):
if not salt: salt = _C.rand.block(h.hashsz)
tag = '%s\0%s' % (pp, salt)
Crypto.__init__(me, c, h, m,
- h().hash('cipher:' + tag).done(),
- h().hash('mac:' + tag).done())
+ h().hash('cipher:' + tag).done(),
+ h().hash('mac:' + tag).done())
me.salt = salt
class Buffer (object):
k = me.k
while True:
if k is None:
- raise StopIteration
+ raise StopIteration
if k[0] == '$':
- break
+ break
k = me.pw.db.nextkey(k)
me.k = me.pw.db.nextkey(k)
return me.pw.unpack(me.pw.db[k])[0]
tag = me.db['tag']
_C.ppcancel(tag)
ppk = PPK(_C.ppread(tag, _C.PMODE_VERIFY),
- me.k.c.__class__, me.k.h, me.k.m.__class__)
+ me.k.c.__class__, me.k.h, me.k.m.__class__)
me.db['key'] = ppk.encrypt(_wrapstr(me.ck) + _wrapstr(me.mk))
me.db['salt'] = ppk.salt
def pack(me, key, value):