mirror of https://github.com/desaster/kippo.git
fix deprecation warnings when creating the keypair
git-svn-id: https://kippo.googlecode.com/svn/trunk@115 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
f28a852518
commit
8a34f34062
|
@ -386,10 +386,11 @@ def getRSAKeys():
|
||||||
# generate a RSA keypair
|
# generate a RSA keypair
|
||||||
print "Generating RSA keypair..."
|
print "Generating RSA keypair..."
|
||||||
from Crypto.PublicKey import RSA
|
from Crypto.PublicKey import RSA
|
||||||
|
from twisted.python import randbytes
|
||||||
KEY_LENGTH = 1024
|
KEY_LENGTH = 1024
|
||||||
rsaKey = RSA.generate(KEY_LENGTH, common.entropy.get_bytes)
|
rsaKey = RSA.generate(KEY_LENGTH, randbytes.secureRandom)
|
||||||
publicKeyString = keys.makePublicKeyString(rsaKey)
|
publicKeyString = keys.Key(rsaKey).public().toString('openssh')
|
||||||
privateKeyString = keys.makePrivateKeyString(rsaKey)
|
privateKeyString = keys.Key(rsaKey).toString('openssh')
|
||||||
# save keys for next time
|
# save keys for next time
|
||||||
file(public_key, 'w+b').write(publicKeyString)
|
file(public_key, 'w+b').write(publicKeyString)
|
||||||
file(private_key, 'w+b').write(privateKeyString)
|
file(private_key, 'w+b').write(privateKeyString)
|
||||||
|
|
Loading…
Reference in New Issue