From 8a34f34062ca490661cf1bdfa63b497401dcbb27 Mon Sep 17 00:00:00 2001 From: desaster Date: Tue, 1 Jun 2010 05:36:14 +0000 Subject: [PATCH] fix deprecation warnings when creating the keypair git-svn-id: https://kippo.googlecode.com/svn/trunk@115 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/core/honeypot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kippo/core/honeypot.py b/kippo/core/honeypot.py index 93af47f..4c5157c 100644 --- a/kippo/core/honeypot.py +++ b/kippo/core/honeypot.py @@ -386,10 +386,11 @@ def getRSAKeys(): # generate a RSA keypair print "Generating RSA keypair..." from Crypto.PublicKey import RSA + from twisted.python import randbytes KEY_LENGTH = 1024 - rsaKey = RSA.generate(KEY_LENGTH, common.entropy.get_bytes) - publicKeyString = keys.makePublicKeyString(rsaKey) - privateKeyString = keys.makePrivateKeyString(rsaKey) + rsaKey = RSA.generate(KEY_LENGTH, randbytes.secureRandom) + publicKeyString = keys.Key(rsaKey).public().toString('openssh') + privateKeyString = keys.Key(rsaKey).toString('openssh') # save keys for next time file(public_key, 'w+b').write(publicKeyString) file(private_key, 'w+b').write(privateKeyString)