From 81ba7dccef0f19df2025b0cb577409b143260732 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 28 Jun 2005 03:44:25 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-15] random doc/comment tweaks --- paramiko/pkey.py | 5 +---- paramiko/rsakey.py | 10 ++++------ paramiko/server.py | 2 +- paramiko/sftp_client.py | 2 -- paramiko/sftp_file.py | 2 -- paramiko/util.py | 4 +--- 6 files changed, 7 insertions(+), 18 deletions(-) diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 315879e..79f56bc 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Copyright (C) 2003-2005 Robey Pointer # # 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 567c716..2e86856 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Copyright (C) 2003-2005 Robey Pointer # # 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 5a425ed..fcbbb41 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 fcf7706..50591cb 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index a2c8902..c173d1c 100644 --- a/paramiko/sftp_file.py +++ b/paramiko/sftp_file.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. diff --git a/paramiko/util.py b/paramiko/util.py index 2a9909c..1b620b8 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Copyright (C) 2003-2005 Robey Pointer # # 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