Skip to content

Commit

Permalink
add check for invalid private key format
Browse files Browse the repository at this point in the history
  • Loading branch information
shea256 committed Apr 23, 2015
1 parent a991c5b commit b8e5ef1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Halfmoon Labs
Copyright (c) 2015 Halfmoon Labs Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 2 additions & 0 deletions pybitcoin/privatekey.py
Expand Up @@ -62,6 +62,8 @@ def __init__(self, private_key=None):
elif is_wif_pk(private_key):
secret_exponent = int(
hexlify(b58check_decode(private_key)), 16)
else:
raise Exception('Not a valid private key format.')

# make sure that: 1 <= secret_exponent < curve_order
if not is_secret_exponent(secret_exponent, self._curve.order):
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Expand Up @@ -8,12 +8,13 @@

setup(
name='pybitcoin',
version='0.8.0',
url='https://github.com/openname/pybitcoin',
version='0.8.1',
url='https://github.com/namesystem/pybitcoin',
license='MIT',
author='Halfmoon Labs, Inc.',
author_email='hello@onename.com',
description='Tools for Bitcoin & other cryptocurrencies (private & public keys, addresses, transactions, RPC, etc.).',
description=("Tools for Bitcoin & other cryptocurrencies (private & ",
"public keys, addresses, transactions, RPC, etc.)."),
keywords='bitcoin btc litecoin namecoin dogecoin cryptocurrency',
packages=find_packages(),
zip_safe=False,
Expand Down

0 comments on commit b8e5ef1

Please sign in to comment.