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

Update aries-askar patch version to at least 0.2.4 as 0.2.3 does not include backward compatibility #1603

Merged

Conversation

acuderman
Copy link
Contributor

Issue

  • When signing the proof presentation or credential using BLS key created before the aries-askar update the process fails with:
File "/aries-cloudagent-python/aries_cloudagent/wallet/askar.py", line 592, in sign_message
key = keypair.key
File "/usr/local/lib/python3.6/site-packages/cached_property.py", line 36, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
File "/usr/local/lib/python3.6/site-packages/aries_askar/store.py", line 147, in key
return Key(self._list.load_key(self._pos))
File "/usr/local/lib/python3.6/site-packages/aries_askar/bindings.py", line 210, in load_key
byref(handle),
File "/usr/local/lib/python3.6/site-packages/aries_askar/bindings.py", line 531, in do_call
raise get_current_error(True)
aries_askar.error.AskarError: Unsupported JWK for key import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/ddtrace/contrib/aiohttp/middlewares.py", line 61, in attach_context
response = await handler(request)
File "/aries-cloudagent-python/aries_cloudagent/admin/server.py", line 163, in ready_middleware
return await handler(request)
File "/aries-cloudagent-python/aries_cloudagent/admin/server.py", line 200, in debug_middleware
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp_apispec/middlewares.py", line 45, in validation_middleware
return await handler(request)
File "/aries-cloudagent-python/aries_cloudagent/admin/server.py", line 339, in check_multitenant_authorization
return await handler(request)
File "/aries-cloudagent-python/aries_cloudagent/admin/server.py", line 383, in setup_context
return await task
File "/aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v2_0/routes.py", line 1072, in present_proof_send_presentation
comment=comment,
File "/aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v2_0/manager.py", line 264, in create_pres
request_data,
File "/aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/handler.py", line 371, in create_pres
records_filter=limit_record_ids,
File "/aries-cloudagent-python/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py", line 1290, in create_vp
document_loader=document_loader,
File "/aries-cloudagent-python/aries_cloudagent/vc/vc_ld/prove.py", line 101, in sign_presentation
document_loader=document_loader,
File "/aries-cloudagent-python/aries_cloudagent/vc/ld_proofs/ld_proofs.py", line 41, in sign
document_loader=document_loader,
File "/aries-cloudagent-python/aries_cloudagent/vc/ld_proofs/proof_set.py", line 53, in add
document=input, purpose=purpose, document_loader=document_loader
File "/aries-cloudagent-python/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020.py", line 82, in create_proof
proof = await self.sign(verify_data=verify_data, proof=proof)
File "/aries-cloudagent-python/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_2020.py", line 181, in sign
signature = await self.key_pair.sign(verify_data)
File "/aries-cloudagent-python/aries_cloudagent/vc/ld_proofs/crypto/wallet_key_pair.py", line 38, in sign
from_verkey=self.public_key_base58,
File "/aries-cloudagent-python/aries_cloudagent/wallet/askar.py", line 604, in sign_message
raise WalletError("Exception when signing message") from err
aries_cloudagent.wallet.error.WalletError: Exception when signing message

@andrewwhitehead Can you please take a look and advise on a proper fix?

@acuderman acuderman force-pushed the fix-revert-askar-package branch from ea46c8d to 5b3262f Compare January 18, 2022 15:14
@andrewwhitehead
Copy link
Contributor

I think this can be addressed in Askar by also accepting the 'EC' key type when loading the key. I'd prefer not to require 0.2.2 as that version has no Python package available for Arm64.

@acuderman
Copy link
Contributor Author

Thanks, @andrewwhitehead for the fix. I updated this PR to a new patch version

@acuderman acuderman force-pushed the fix-revert-askar-package branch from 33dd47c to a5e4c7d Compare January 19, 2022 07:51
@acuderman acuderman changed the title Set aries askar 0.2.2 as a hard dependency as 0.2.3 breaks bbs signing Update aries-askar patch version to at least 0.2.4 as 0.2.3 does not include backward compatibility Jan 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2022

Codecov Report

Merging #1603 (a5e4c7d) into main (7024c5a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1603   +/-   ##
=======================================
  Coverage   95.74%   95.74%           
=======================================
  Files         528      528           
  Lines       32515    32515           
=======================================
  Hits        31133    31133           
  Misses       1382     1382           

@andrewwhitehead andrewwhitehead merged commit 308161f into openwallet-foundation:main Jan 19, 2022
@ctomc ctomc deleted the fix-revert-askar-package branch August 18, 2022 10:01
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

Successfully merging this pull request may close these issues.

3 participants