Skip to content

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

Merged
vladimir-v-diaz merged 2 commits into
theupdateframework:developfrom
lukpueh:fix-#412
Jun 15, 2017
Merged

vladimir-v-diaz merged 2 commits into
theupdateframework:developfrom
lukpueh:fix-#412

Conversation

@lukpueh

@lukpueh lukpueh commented Jan 27, 2017

Copy link
Copy Markdown
Member

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)

Lukas Puehringer added 2 commits January 27, 2017 17:07
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

lukpueh commented Jan 27, 2017

Copy link
Copy Markdown
Member Author

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
Copy Markdown

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