Skip to content

Commit bc93352

Browse files
Merge pull request #33 from lukpueh/fixes-docstrings
Removes ssl_crypto/ssl_commons relicts in docstrings
2 parents 4c174fd + 9128c23 commit bc93352

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

securesystemslib/ed25519_keys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
signatures (64 bytes) and small public keys (32 bytes).
1818
http://ed25519.cr.yp.to/
1919
20-
'ssl_crypto/ed25519_keys.py' calls 'ed25519.py', which is the pure Python
20+
'securesystemslib/ed25519_keys.py' calls 'ed25519.py', which is the pure Python
2121
implementation of ed25519 optimized for a faster runtime. The Python
2222
reference implementation is concise, but very slow (verifying signatures
2323
takes ~9 seconds on an Intel core 2 duo @ 2.2 ghz x 2). The optimized
@@ -220,7 +220,7 @@ def create_signature(public_key, private_key, data):
220220
nacl.signing.SigningKey.sign() called to generate the actual signature.
221221
222222
<Returns>
223-
A signature dictionary conformat to 'ssl_crypto.format.SIGNATURE_SCHEMA'.
223+
A signature dictionary conformat to 'securesystemslib.format.SIGNATURE_SCHEMA'.
224224
ed25519 signatures are 64 bytes, however, the hexlified signature is
225225
stored in the dictionary returned.
226226
"""
@@ -297,7 +297,7 @@ def verify_signature(public_key, method, signature, data, use_pynacl=False):
297297
The signature is a 64-byte string.
298298
299299
data:
300-
Data object used by ssl_crypto.ed25519_keys.create_signature() to generate
300+
Data object used by securesystemslib.ed25519_keys.create_signature() to generate
301301
'signature'. 'data' is needed here to verify the signature.
302302
303303
use_pynacl:
@@ -307,12 +307,12 @@ def verify_signature(public_key, method, signature, data, use_pynacl=False):
307307
308308
<Exceptions>
309309
securesystemslib.exceptions.UnknownMethodError. Raised if the signing method used by
310-
'signature' is not one supported by ssl_crypto.ed25519_keys.create_signature().
310+
'signature' is not one supported by securesystemslib.ed25519_keys.create_signature().
311311
312312
securesystemslib.exceptions.FormatError. Raised if the arguments are improperly formatted.
313313
314314
<Side Effects>
315-
ssl_crypto._vendor.ed25519.ed25519.checkvalid() called to do the actual
315+
securesystemslib._vendor.ed25519.ed25519.checkvalid() called to do the actual
316316
verification. nacl.signing.VerifyKey.verify() called if 'use_pynacl' is
317317
True.
318318

securesystemslib/formats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def encode_canonical(object, output_function=None):
787787
(e.g., output_function('result')).
788788
789789
<Exceptions>
790-
ssl_commons.exceptions.FormatError, if 'object' cannot be encoded or 'output_function'
790+
securesystemslib.exceptions.FormatError, if 'object' cannot be encoded or 'output_function'
791791
is not callable.
792792
793793
<Side Effects>

securesystemslib/hash.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737

3838
import securesystemslib.exceptions
3939

40-
# Import ssl_crypto logger to log warning messages.
40+
# Import securesystemslib logger to log warning messages.
4141
logger = logging.getLogger('securesystemslib.hash')
4242

4343
# The list of hash libraries imported successfully.
4444
_supported_libraries = []
4545

46-
# Hash libraries currently supported by ssl_crypto.hash.
46+
# Hash libraries currently supported by securesystemslib.hash.
4747
_SUPPORTED_LIB_LIST = ['hashlib', 'pycrypto']
4848

4949
# Let's try importing the pycrypto hash algorithms. Pycrypto will
@@ -101,9 +101,9 @@ def digest(algorithm=_DEFAULT_HASH_ALGORITHM,
101101
102102
# Creation of a digest object using defaults
103103
# or by specifying hash algorithm and library.
104-
digest_object = ssl_crypto.hash.digest()
105-
digest_object = ssl_crypto.hash.digest('sha384')
106-
digest_object = ssl_crypto.hash.digest('pycrypto')
104+
digest_object = securesystemslib.hash.digest()
105+
digest_object = securesystemslib.hash.digest('sha384')
106+
digest_object = securesystemslib.hash.digest('pycrypto')
107107
108108
# The expected interface for digest objects.
109109
digest_object.digest_size
@@ -112,8 +112,8 @@ def digest(algorithm=_DEFAULT_HASH_ALGORITHM,
112112
digest_object.digest()
113113
114114
# Added hash routines by this module.
115-
digest_object = ssl_crypto.hash.digest_fileobject(file_object)
116-
digest_object = ssl_crypto.hash.digest_filename(filename)
115+
digest_object = securesystemslib.hash.digest_fileobject(file_object)
116+
digest_object = securesystemslib.hash.digest_filename(filename)
117117
118118
<Arguments>
119119
algorithm:
@@ -199,7 +199,7 @@ def digest_fileobject(file_object, algorithm=_DEFAULT_HASH_ALGORITHM,
199199
securesystemslib.exceptions.Error
200200
201201
<Side Effects>
202-
Calls ssl_crypto.hash.digest() to create the actual digest object.
202+
Calls securesystemslib.hash.digest() to create the actual digest object.
203203
204204
<Returns>
205205
Digest object (e.g., hashlib.new(algorithm) or
@@ -260,7 +260,7 @@ def digest_filename(filename, algorithm=_DEFAULT_HASH_ALGORITHM,
260260
securesystemslib.exceptions.Error
261261
262262
<Side Effects>
263-
Calls ssl_crypto.hash.digest_fileobject() after opening 'filename'.
263+
Calls securesystemslib.hash.digest_fileobject() after opening 'filename'.
264264
File closed before returning.
265265
266266
<Returns>

securesystemslib/pyca_crypto_keys.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
from cryptography.hazmat.primitives.asymmetric import padding
102102

103103
# Import pyca/cryptography's Key Derivation Function (KDF) module.
104-
# 'ssl_crypto.keys.py' needs this module to derive a secret key according to the
104+
# 'securesystemslib.keys.py' needs this module to derive a secret key according to the
105105
# Password-Based Key Derivation Function 2 specification. The derived key is
106106
# used as the symmetric key to encrypt TUF key information.
107107
# PKCS#5 v2.0 PBKDF2 specification: http://tools.ietf.org/html/rfc2898#section-5.2
@@ -376,15 +376,15 @@ def verify_rsa_signature(signature, signature_method, public_key, data):
376376
The RSA public key, a string in PEM format.
377377
378378
data:
379-
Data used by ssl_crypto.keys.create_signature() to generate
379+
Data used by securesystemslib.keys.create_signature() to generate
380380
'signature'. 'data' (a string) is needed here to verify 'signature'.
381381
382382
<Exceptions>
383383
securesystemslib.exceptions.FormatError, if 'signature', 'signature_method', 'public_key', or
384384
'data' are improperly formatted.
385385
386386
securesystemslib.exceptions.UnknownMethodError, if the signing method used by
387-
'signature' is not one supported by ssl_crypto.keys.create_signature().
387+
'signature' is not one supported by securesystemslib.keys.create_signature().
388388
389389
securesystemslib.exceptions.CryptoError, if the private key cannot be decoded or its key type
390390
is unsupported.
@@ -426,7 +426,7 @@ def verify_rsa_signature(signature, signature_method, public_key, data):
426426
backend=default_backend())
427427

428428
# 'salt_length' is set to the digest size of the hashing algorithm (to
429-
# match the default size used by 'ssl_crypto.pycrypto_keys.py').
429+
# match the default size used by 'securesystemslib.pycrypto_keys.py').
430430
verifier = public_key_object.verifier(signature,
431431
padding.PSS(mgf=padding.MGF1(hashes.SHA256()),
432432
salt_length=hashes.SHA256().digest_size),

securesystemslib/pycrypto_keys.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,13 @@ def verify_rsa_signature(signature, signature_method, public_key, data):
353353
The RSA public key, a string in PEM format.
354354
355355
data:
356-
Data object used by ssl_crypto__keys.create_signature() to generate
356+
Data object used by securesystemslib.keys.create_signature() to generate
357357
'signature'. 'data' is needed here to verify the signature.
358358
359359
<Exceptions>
360360
securesystemslib.exceptions.UnknownMethodError. Raised if the signing method
361361
used by 'signature' is not one supported by
362-
ssl_crypto__keys.create_signature().
362+
securesystemslib.keys.create_signature().
363363
364364
securesystemslib.exceptions.FormatError. Raised if 'signature',
365365
'signature_method', or 'public_key' is improperly formatted.
@@ -543,10 +543,10 @@ def create_rsa_public_and_private_from_pem(pem, passphrase=None):
543543
it is used to derive a stronger symmetric key.
544544
545545
<Exceptions>
546-
ssl_commons.exceptions.FormatError, if the arguments are improperly
546+
securesystemslib.exceptions.FormatError, if the arguments are improperly
547547
formatted.
548548
549-
ssl_commons.exceptions.CryptoError, if the public and private RSA keys
549+
securesystemslib.exceptions.CryptoError, if the public and private RSA keys
550550
cannot be generated from 'encrypted_pem', or exported in PEM format.
551551
552552
<Side Effects>

securesystemslib/schema.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@
2424
For example:
2525
>>> good = {'first': 'Marty', 'last': 'McFly'}
2626
>>> bad = {'sdfsfd': 'Biff', 'last': 'Tannen'}
27+
>>> bad = {'sdfsfd': 'Biff', 'last': 'Tannen'}
2728
>>> schema = Object(first=AnyString(), last=AnyString())
2829
>>> schema.matches(good)
2930
True
3031
>>> schema.matches(bad)
3132
False
3233
In the process of determining if the two objects matched the template,
33-
ssl_commons.schema.Object() inspected the named keys of both dictionaries.
34+
securesystemslib.schema.Object() inspected the named keys of both dictionaries.
3435
In the case of the 'bad' dict, a 'first' dict key could not be found.
3536
As a result, 'bad' was flagged a mismatch.
3637
3738
'schema.py' provides additional schemas for testing objects based on other
38-
criteria. See 'ssl_crypto.formats.py' and the rest of this module for extensive
39+
criteria. See 'securesystemslib.formats.py' and the rest of this module for extensive
3940
examples. Anything related to the checking of TUF objects and their formats
4041
can be found in 'formats.py'.
4142
"""

0 commit comments

Comments
 (0)