Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> I tried to create key.pem following https://github.com/starkbank/ecdsa-python: #20

Open
mervit93 opened this issue Oct 23, 2024 · 0 comments

Comments

@mervit93
Copy link

I tried to create key.pem following https://github.com/starkbank/ecdsa-python:

openssl ecparam -name secp256k1 -genkey -out privateKey.pem
openssl ec -in privateKey.pem -pubout -out publicKey.pem

and then rename privateKey.pem to key.pem next to the server py file.

however when running showing ads, it throws:

[2020-07-13 20:57:53,093] ERROR in app: Exception on /get-ad-impression [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "skadnetwork_server.py", line 58, in get_skadnetwork_parameters
    ecdsa = ECDSA(ECDSA_PRIVATE)
  File "/Users/xuanliu/Downloads/Singular-SKAdNetwork-App-master/skadnetwork-server/ecdsa_wrapper.py", line 28, in __init__
    self._pubkey = fe_keys.get_public_key(self._key, self.CURVE)
  File "/usr/local/lib/python3.7/site-packages/fastecdsa/keys.py", line 81, in get_public_key
    return d * curve.G
  File "/usr/local/lib/python3.7/site-packages/fastecdsa/point.py", line 163, in __rmul__
    return self.__mul__(scalar)
  File "/usr/local/lib/python3.7/site-packages/fastecdsa/point.py", line 135, in __mul__
    validate_type(scalar, int)
  File "/usr/local/lib/python3.7/site-packages/fastecdsa/util.py", line 170, in validate_type
    expected_type, type(instance)))
TypeError: Expected a value of type <class 'int'>, got a value of type <class 'NoneType'>
127.0.0.1 - - [13/Jul/2020 20:57:53] "GET /get-ad-impression?skadnetwork_version=2.0&source_app_id=654321 HTTP/1.1" 500 -

it seems it failed to read public key? please fix and maybe add a doc about this. thank you

Originally posted by @mervit93 in #6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant