summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-06-28 03:44:25 +0000
committerRobey Pointer <robey@lag.net>2005-06-28 03:44:25 +0000
commit81ba7dccef0f19df2025b0cb577409b143260732 (patch)
tree299f8ad890530aa4f7de43297a2b13a72cb16efe
parentc0b22a3aec9f2a4868bbed23dc6e2542097a18f9 (diff)
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-15]
random doc/comment tweaks
-rw-r--r--paramiko/pkey.py5
-rw-r--r--paramiko/rsakey.py10
-rw-r--r--paramiko/server.py2
-rw-r--r--paramiko/sftp_client.py2
-rw-r--r--paramiko/sftp_file.py2
-rw-r--r--paramiko/util.py4
6 files changed, 7 insertions, 18 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index 315879e7..79f56bc1 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
@@ -127,7 +125,7 @@ class PKey (object):
secret is revealed.
@return: a 16-byte string (binary) of the MD5 fingerprint, in SSH
- format.
+ format.
@rtype: str
"""
return MD5.new(str(self)).digest()
@@ -286,7 +284,6 @@ class PKey (object):
cipher = self._CIPHER_TABLE[encryption_type]['cipher']
keysize = self._CIPHER_TABLE[encryption_type]['keysize']
mode = self._CIPHER_TABLE[encryption_type]['mode']
- # this confusing line turns something like '2F91' into '/\x91' (sorry, was feeling clever)
salt = util.unhexify(saltstr)
key = util.generate_key_bytes(MD5, salt, password, keysize)
return cipher.new(key, mode, salt).decrypt(data)
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py
index 567c716a..2e868563 100644
--- a/paramiko/rsakey.py
+++ b/paramiko/rsakey.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
@@ -90,11 +88,11 @@ class RSAKey (PKey):
def verify_ssh_sig(self, data, msg):
if msg.get_string() != 'ssh-rsa':
return False
- sig = util.inflate_long(msg.get_string(), 1)
- # verify the signature by SHA'ing the data and encrypting it using the
+ sig = util.inflate_long(msg.get_string(), True)
+ # verify the signature by SHA'ing the data and encrypting it using theŚ
# public key. some wackiness ensues where we "pkcs1imify" the 20-byte
# hash into a string as long as the RSA key.
- hash = util.inflate_long(self._pkcs1imify(SHA.new(data).digest()), 1)
+ hash = util.inflate_long(self._pkcs1imify(SHA.new(data).digest()), True)
rsa = RSA.construct((long(self.n), long(self.e)))
return rsa.verify(hash, (sig,))
@@ -117,7 +115,7 @@ class RSAKey (PKey):
@param bits: number of bits the generated key should be.
@type bits: int
@param progress_func: an optional function to call at key points in
- key generation (used by C{pyCrypto.PublicKey}).
+ key generation (used by C{pyCrypto.PublicKey}).
@type progress_func: function
@return: new private key
@rtype: L{RSAKey}
diff --git a/paramiko/server.py b/paramiko/server.py
index 5a425edd..fcbbb411 100644
--- a/paramiko/server.py
+++ b/paramiko/server.py
@@ -250,7 +250,7 @@ class ServerInterface (object):
The default implementation always returns C{False}.
- @param channel: the L{Channel} the pty request arrived on.
+ @param channel: the L{Channel} the request arrived on.
@type channel: L{Channel}
@return: C{True} if this channel is now hooked up to a shell; C{False}
if a shell can't or won't be provided.
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index fcf77063..50591cbb 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py
index a2c8902a..c173d1c8 100644
--- a/paramiko/sftp_file.py
+++ b/paramiko/sftp_file.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
diff --git a/paramiko/util.py b/paramiko/util.py
index 2a9909c7..1b620b86 100644
--- a/paramiko/util.py
+++ b/paramiko/util.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
@@ -147,7 +145,7 @@ def generate_key_bytes(hashclass, salt, key, nbytes):
is used for encrypting/decrypting private key files.
@param hashclass: class from L{Crypto.Hash} that can be used as a secure
- hashing function (like C{MD5} or C{SHA}).
+ hashing function (like C{MD5} or C{SHA}).
@type hashclass: L{Crypto.Hash}
@param salt: data to salt the hash with.
@type salt: string