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

Updates repository_lib to use new securesystemslib interface (fix #412) #422

Merged
merged 2 commits into from
Jun 15, 2017

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Jan 27, 2017

Fixes #412

  • securesystemslib copies functions to generate and import keys from repository_lib.
    This PR replaces those function implementations with calls to securesystemslib.interface.

  • Removes internal _prompt and _get_password from repository_lib because they were only used by the removed function bodies and also exist in securesystemslib.interface.

  • Updates requirements.txt and setup.py to point to a securesystemslib branch that updates key generate and import functions to return a key object with the optional keyid_hash_algorithms field.

ONLY MERGE AFTER lukpueh/securesystemslib/update-import-keys has merged into securesystemslib/master and above references have been updated!!

(@SantiagoTorres secretly dances the we-should-have-used-git-submodules-dance)

securesystemslib.interface copies functions to generate and
import keys from repository_lib.
This commit replaces those function implementations with calls
to securesystemslib.

Removes internal _prompt and _get_password from repository_lib
because they were only used by the removed function bodies and
also exist in securesystemslib.interface
Updates requirements.txt and setup.py requirements to point to a
securesystemslib branch that updates key generate and import
functions to return a key object with the optional
keyid_hash_algorithms field.

This references have to be updated once lukpueh:update-import-keys
is merged into securesystemslib's master.
@lukpueh
Copy link
Member Author

lukpueh commented Jan 27, 2017

And here is the shell snippet:

>>> import tuf.repository_lib as rl
>>> rl.generate_and_write_ed25519_keypair('testkey', 'pw')
>>> rl.import_ed25519_privatekey_from_file('testkey', 'pw')
{
  u'keytype': u'ed25519',
  u'keyid': u'f9d7e20448545d1ecab27c2a3011ab6332e974054c83818c9550690c26a7e02a',
  u'keyval': {
    u'public': u'9ce9a03e4dcd3fee4baa97393783fce76fc583d2896abcb0e556208f1a894ab6',
    u'private': u'19de8e160bf6d5df56715485c49a6c9683464a9388215b82ed2a0c2daa02d362'
  },
  u'keyid_hash_algorithms': [u'sha256', u'sha512']
}
>>> rl.import_ed25519_publickey_from_file('testkey.pub')
{
  u'keytype': u'ed25519',
  u'keyid': 'f9d7e20448545d1ecab27c2a3011ab6332e974054c83818c9550690c26a7e02a',
  u'keyval': {
    u'public': u'9ce9a03e4dcd3fee4baa97393783fce76fc583d2896abcb0e556208f1a894ab6'
  },
  u'keyid_hash_algorithms': [u'sha256', u'sha512']
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 97.919% when pulling 3982a56 on lukpueh:fix-#412 into 6fde622 on theupdateframework:develop.

@awwad awwad force-pushed the develop branch 2 times, most recently from 61d04eb to 40aaf93 Compare March 22, 2017 16:11
@vladimir-v-diaz vladimir-v-diaz mentioned this pull request Jun 15, 2017
@vladimir-v-diaz vladimir-v-diaz merged commit 3982a56 into theupdateframework:develop Jun 15, 2017
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