[i] does not generally mean anything in kippo

This commit is contained in:
Upi Tamminen
2014-08-09 15:01:58 +03:00
parent baeda78839
commit 6e6a8aa4c1

View File

@ -730,7 +730,7 @@ def getRSAKeys():
public_key = cfg.get('honeypot', 'rsa_public_key') public_key = cfg.get('honeypot', 'rsa_public_key')
private_key = cfg.get('honeypot', 'rsa_private_key') private_key = cfg.get('honeypot', 'rsa_private_key')
if not (os.path.exists(public_key) and os.path.exists(private_key)): if not (os.path.exists(public_key) and os.path.exists(private_key)):
print "[i] Generating new RSA keypair..." print "Generating new RSA keypair..."
from Crypto.PublicKey import RSA from Crypto.PublicKey import RSA
from twisted.python import randbytes from twisted.python import randbytes
KEY_LENGTH = 2048 KEY_LENGTH = 2048
@ -739,7 +739,7 @@ def getRSAKeys():
privateKeyString = twisted.conch.ssh.keys.Key(rsaKey).toString('openssh') privateKeyString = twisted.conch.ssh.keys.Key(rsaKey).toString('openssh')
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)
print "[i] Done." print "Done."
else: else:
publicKeyString = file(public_key).read() publicKeyString = file(public_key).read()
privateKeyString = file(private_key).read() privateKeyString = file(private_key).read()
@ -750,7 +750,7 @@ def getDSAKeys():
public_key = cfg.get('honeypot', 'dsa_public_key') public_key = cfg.get('honeypot', 'dsa_public_key')
private_key = cfg.get('honeypot', 'dsa_private_key') private_key = cfg.get('honeypot', 'dsa_private_key')
if not (os.path.exists(public_key) and os.path.exists(private_key)): if not (os.path.exists(public_key) and os.path.exists(private_key)):
print "[i] Generating new DSA keypair..." print "Generating new DSA keypair..."
from Crypto.PublicKey import DSA from Crypto.PublicKey import DSA
from twisted.python import randbytes from twisted.python import randbytes
KEY_LENGTH = 1024 KEY_LENGTH = 1024
@ -759,7 +759,7 @@ def getDSAKeys():
privateKeyString = twisted.conch.ssh.keys.Key(dsaKey).toString('openssh') privateKeyString = twisted.conch.ssh.keys.Key(dsaKey).toString('openssh')
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)
print "[i] Done." print "Done."
else: else:
publicKeyString = file(public_key).read() publicKeyString = file(public_key).read()
privateKeyString = file(private_key).read() privateKeyString = file(private_key).read()