Commit Graph

394 Commits

Author SHA1 Message Date
Dane Fichter d48b590c35 This change adds Sign operation support to the server. 2017-08-28 12:47:23 -04:00
Dane df06aa8ad8 Add engine support for sign operation
This change adds the sign operation functionality
to the cryptography engine.
2017-08-25 10:31:11 -04:00
Peter Hamilton df74c854b7 Merge pull request #325 from OpenKMIP/feat/add-signature-verify-payloads
Add payloads for the SignatureVerify operation
2017-08-21 16:53:21 -04:00
Peter Hamilton c5cf2c3846 Merge pull request #323 from OpenKMIP/feat/add-encrypt-decrypt-demos
Add ProxyKmipClient demos for the Encrypt / Decrypt operations
2017-08-21 16:52:44 -04:00
Peter Hamilton 1aa24586f5 Merge pull request #322 from OpenKMIP/feat/add-asymmetric-encrypt-support
Add support for asymmetric encryption and decryption
2017-08-21 16:51:33 -04:00
Peter Hamilton a6d3b944ab Add payloads for the SignatureVerify operation
This change adds request and response payloads for the
SignatureVerify operation. Payload factories have been updated to
support SignatureVerify and new unit test suites have been added
to cover the new payload code.
2017-08-18 10:41:03 -04:00
Peter Hamilton a11bb8da05 Add KMIP 1.4 enumerations
This change updates the set of supported enumerations to include
those added by KMIP 1.4
2017-08-15 16:07:28 -04:00
Peter Hamilton b0d454da9a Add ProxyKmipClient demos for the Encrypt / Decrypt operations
This change adds demos for the ProxyKmipClient, demonstrating how
to encrypt and decrypt messages. Demo utilities have been updated
to support the new demo scripts and the KMIPProxy client has been
updated to correctly return operation results.
2017-08-15 11:10:57 -04:00
Peter Hamilton 89c997c337 Add support for asymmetric encryption and decryption
This change updates the encrypt/decrypt support in the cryptography
engine to support asymmetric key algorithms, specifically RSA. Unit
tests have been added to validate the new functionality.
2017-08-14 21:10:12 -04:00
Peter Hamilton 5758c6dd1e Merge pull request #321 from OpenKMIP/feat/enforce-derive-key-length
Enforce server support for DeriveKey truncation
2017-08-10 17:30:32 -04:00
Peter Hamilton 0009bb2b5a Enforce server support for DeriveKey truncation
This change updates DeriveKey support in the software server to
enforce key truncation. If the derived key is longer than the
requested cryptographic length, the derived key is truncated to
fit the requested length. A unit test has been added to cover
this update.
2017-08-09 15:58:03 -04:00
Peter Hamilton 56b8a9f04b Add DeriveKey integration tests for the ProxyKmipClient
This change adds several integration tests that exercise the
DeriveKey functionality supported by the ProxyKmipClient. These
tests pass when run against the PyKMIP software server.
2017-08-09 15:37:46 -04:00
Peter Hamilton 125bbee9ad Merge pull request #319 from OpenKMIP/bug/fix-get-integration-tests
Fix integration test errors involving Get payloads
2017-08-09 14:25:31 -04:00
Peter Hamilton 015368161c Fix integration test errors involving Get payloads
This change fixes a series of bugs in the integration test suite
introduced by the previous Get payload update. The integration
test suite now runs successfully against the PyKMIP software
server.
2017-08-09 13:51:29 -04:00
Peter Hamilton ec61f1861d Add a ProxyKmipClient demo for the DeriveKey operation
This change adds a demo for the ProxyKmipClient, demonstrating how
to derive keys in a variety of ways, including via encryption,
hashing, HMAC, PBKDF2, and NIST 800 108-C.
2017-08-09 13:25:23 -04:00
Peter Hamilton 357ac022c4 Merge pull request #317 from OpenKMIP/feat/add-derive-key-to-clients
Add DeriveKey support to the clients
2017-08-09 13:05:13 -04:00
Peter Hamilton 6071c938b6 Add DeriveKey support to the clients
This change adds DeriveKey operation support to the KMIPProxy and
ProxyKmipClient clients, including unit tests to cover the new
functionality.
2017-08-08 14:54:48 -04:00
Peter Hamilton 278a54320c Merge pull request #297 from OpenKMIP/feat/add-decrypt-to-clients
Add Decrypt support to the clients
2017-07-27 12:31:33 -04:00
Peter Hamilton a4b7b433b4 Add Decrypt support to the server
This change adds the Decrypt operation to the server. Support is
currently limited to symmetric decryption only. The decryption key
used with the operation must be in the Active state and it must
have the Decrypt bit set in its cryptographic usage mask.
2017-07-27 12:03:27 -04:00
Peter Hamilton 7c6e45f549 Fix bug generating detached instance errors in server tests
This patch fixes a bug that generates intermittent sqlalchemy
DetachedInstanceErrors during the KMIP server engine unit test
execution. Specifically, this fix disables instance expiration on
commit for the sqlalchemy sessions used throughout the unit tests,
allowing access to instance attributes even if the instance is
detached from a session.

Fixes #312
2017-07-27 11:38:07 -04:00
Peter Hamilton 90fafe8713 Add DeriveKey support to the server
This change adds the DeriveKey operation to the server. Unit tests
covering the new additions are included. The Query operation has
also been updated to reflect this addition.
2017-07-25 13:20:16 -04:00
Peter Hamilton 50b0ae9fee Add server support for Getting wrapped keys
This change adds support for retrieving wrapped keys from the KMIP
server. The only supported key wrapping algorithm currently is
the AES-based NIST Key Wrap algorithm (RFC 3394). MAC/signing is
not supported for key wrapping. Attribute-bundling with the wrapped
key value is not supported. Wrapping of the entire key block TTLV
encoding is not supported. Various additional error cases are
included and checked for.

Unit tests covering the additions to Get are included.
2017-07-25 09:50:11 -04:00
Peter Hamilton 448cf229f6 Fix key wrapping support in the cryptography engine
This change fixes key wrapping support in the cryptography engine.
The original implementation used a CryptographicAlgorithm enum to
determine what key wrapping algorithm to use for key wrapping.
Closer inspection of the KMIP spec indicates that a BlockCipherMode
enum should be used instead. The engine has been updated to reflect
this change, as have the corresponding key wrapping unit tests.
2017-07-24 12:40:46 -04:00
Peter Hamilton 615889f7eb Merge pull request #307 from OpenKMIP/feat/update-key-wrapping-data
Update the KeyWrappingData struct
2017-07-24 12:13:58 -04:00
Peter Hamilton f71500446f Add key wrapping support to the cryptography engine
This change adds key wrapping support to the CryptographyEngine,
supporting RFC 3394, AES Key Wrap, only. Numerous unit tests from
using test vectors from RFC 3394 are included.
2017-07-24 10:24:25 -04:00
Peter Hamilton ba47813553 Update the Get request and response payloads
This change updates the Get payloads to reflect current coding
styles. It streamlines payload usage and makes it easier to create
and access payload fields. A new unit test suite dedicated to the
Get payloads is added. Surrounding code in the client/server and
associated utilities and unit tests are updated to reflect these
changes.
2017-07-20 12:36:42 -04:00
Peter Hamilton 1e6b043ab8 Update the KeyWrappingData struct
This change updates the KeyWrappingData struct to conform with
current library styles. This struct is used with key data to
represent a wrapped key and will be used by future patches to
support key wrapping functionality. Updated unit tests matching
the new additions are included.
2017-07-18 10:31:05 -04:00
Peter Hamilton 0e0e1465e9 Update the KeyWrappingSpecification struct
This change updates the KeyWrappingSpecification struct to conform
with current library styles. This struct is used for key wrapping
functionality and will be used in future patches. Updated unit
tests matching the new additions are included.
2017-07-16 14:41:44 -04:00
Peter Hamilton 2e15a1ca3b Update the MACSignatureKeyInformation struct
This change updates the MACSignatureKeyInformation struct to
conform with current library styles. This struct is used for key
wrapping functionality and will be leveraged by future patches.
Updated unit tests matching the new additions are included.
2017-07-15 13:08:06 -04:00
Peter Hamilton e5d29f031f Update the EncryptionKeyInformation struct
This change updates the EncryptionKeyInformation struct to conform
with current library styles. This struct is used for key wrapping
functionality and will be leveraged by future patches. Updated
unit tests matching the new additions are included.
2017-07-13 15:12:26 -04:00
Peter Hamilton db81d9b16e Merge pull request #299 from OpenKMIP/feat/add-derive
Add key derivation support to the server cryptography engine
2017-07-10 15:58:02 -04:00
Peter Hamilton 86e49b4c35 Add key derivation support to the server cryptography engine
This change adds key derivation functionality to the cryptographic
engine, adding support for multiple key derivation methods,
including encrypting, hashing, HMACing, and specific algorithms
like PBKDF2 and NIST 800-108. Numerous unit tests are included
from established cryptographic testing sources to verify the
added functionality.
2017-07-10 14:19:25 -04:00
Peter Hamilton 62d30be7fa Merge pull request #298 from vbnmmnbv/locate_attributes_server
Add Name attribute filtering of locate for server
2017-07-05 20:23:24 -04:00
Peter Hamilton 4462a4cf42 Update server engine unit tests to improve coverage
This change adds several miscellaneous tests to improve unit test
coverage, minor additions all.
2017-07-05 14:24:38 -04:00
dane-fichter a910dccf07 Adding request and response payloads for the Sign operation 2017-07-05 10:03:58 -04:00
Hao Shen b55a051b26 Add Name attribute filtering of locate for server 2017-06-30 12:27:00 -07:00
Peter Hamilton 0618018c8b Add Decrypt support to the clients
This change adds Decrypt operation support to the KMIPProxy and
ProxyKmipClient clients, including unit tests to cover the new
functionality.
2017-06-28 11:35:38 -04:00
Peter Hamilton 4c244a1f6f Merge pull request #291 from OpenKMIP/feat/add-encrypt-to-clients
Add Encrypt support to the clients
2017-06-28 10:59:30 -04:00
Peter Hamilton 60bd56066e Add decryption support to the server cryptography engine
This change adds decryption functionality to the cryptographic
engine used by the server. It supports a variety of symmetric
decryption algorithms and block cipher modes. Asymmetric
decryption support will be added in a future patch.

Unit tests and minor updates to surrounding code are included.
2017-06-27 14:21:59 -04:00
Peter Hamilton 344cce83da Add request and response payloads for the DeriveKey operation
This change adds request/response payloads for the DeriveKey
operation, updating the payload factories to support DeriveKey.
Unit tests for the payloads and payload factories are included.
The inequality operator was also added to the TemplateAttribute
struct to support the DeriveKey payload unit tests; differences
in Python2.7 and 3+ led to comparison failures.
2017-06-23 18:28:02 -04:00
Peter Hamilton 38ee408b21 Merge pull request #293 from OpenKMIP/feat/add-derivation-parameters
Add the DerivationParameters struct
2017-06-23 18:22:11 -04:00
Peter Hamilton ed22fb15f9 Add the DerivationParameters struct
This change adds support for the DerivationParameters struct,
which is needed for DeriveKey support. Unit tests are included to
cover all newly added code.
2017-06-21 11:14:07 -04:00
Peter Hamilton 3db0bfe88f Add request and response payloads for the Decrypt operation
This change adds request and response payloads for Decrypt
operation, updating the payload factories to support Decrypt
payloads. Unit tests for all new code are included.
2017-06-20 17:12:29 -04:00
Peter Hamilton a5e960153c Add Encrypt support to the clients
This change adds Encrypt operation support to the KMIPProxy and
ProxyKmipClient clients, including unit tests to cover the new
functionality.

Extensive documentation has been added to the header comments for
the new client methods detailing the expected input parameters and
return values. This approach should be followed for all new client
additions going forward.
2017-06-20 11:11:50 -04:00
Peter Hamilton de575303ce Add Encrypt operation support to the server
This change adds the Encrypt operation to the server. Support is
currently limited to symmetric encryption only. The encryption key
used with the operation must be in the Active state and it must
have the Encrypt bit set in its cryptographic usage mask.
2017-06-19 10:59:40 -04:00
Peter Hamilton 920dce73f4 Merge pull request #289 from OpenKMIP/feat/add-encrypt
Add encryption support to the server cryptography engine
2017-06-19 10:38:58 -04:00
Peter Hamilton 7bc613417b Add encryption support to the server cryptography engine
This change adds encryption functionality to the cryptographic
engine used by the server. It supports a variety of symmetric
encryption algorithms and block cipher modes. Asymmetric encryption
support will be added in a future patch.

Unit tests and minor updates to surrounding core code are included.
2017-06-16 16:03:30 -04:00
Peter Hamilton 0f13e0e494 Adding request and response payloads for the Encrypt operation
This change adds request and response payloads for the Encrypt
operation, updating the payload factories to support Encrypt
payloads. Unit tests for all new code are included.
2017-05-31 16:47:19 -04:00
Peter Hamilton 471d0a1ad8 Updating the CryptographicParameters struct
This change updates the CryptographicParameters struct, removing the
primitive class wrappers that it used to use for attribute values
and replacing them with struct properties that internally manage the
primitive objects directly. This gutting and regutting necessitates
cascading changes to every part of the library that used these
internal primitive class wrappers, including unit tests, client and
client tests, and attribute factory handlers. All of these have been
updated to reflect the correct usage of the CryptographicParameters
struct.

This change also adds in additional attribute members for the
CryptographicParameters struct to bring it up to spec with KMIP 1.2.
2017-05-24 15:39:09 -04:00
Peter Hamilton e591873bf4 Merge pull request #284 from vbnmmnbv/revoke_pie
fix compromise_occurrence_date None handling in pie revoke
2017-04-27 19:48:27 -04:00
Hao Shen ac6e117676 fix compromise_occurrence_date None handling in pie revoke 2017-04-25 13:13:31 -07:00
Peter Hamilton 4617ae5280 Merge pull request #283 from vbnmmnbv/rename_compromise_occurrence_date
rename compromise_date to compromise_occurrence_date in revoke reques…
2017-04-21 15:52:04 -04:00
Hao Shen 8f16558b76 rename compromise_date to compromise_occurrence_date 2017-04-21 12:24:48 -07:00
Peter Hamilton 901f2d8097 Merge pull request #282 from vbnmmnbv/add_reset_mock
add missing reset_mock of logger in server revoke operation tests
2017-04-21 15:12:09 -04:00
Peter Hamilton a7c627d28f Merge pull request #274 from vbnmmnbv/destroy_state_permission_server
Add state check for Destroy operation.
2017-04-21 15:06:29 -04:00
Hao Shen 1c565b37f3 add missing reset_mock of logger in server revoke operation tests 2017-04-21 09:50:29 -07:00
Hao Shen 3897455469 Add state check for Destroy operation. 2017-04-21 09:32:26 -07:00
Peter Hamilton f7e0e55955 Merge pull request #276 from vbnmmnbv/create_crypo_usage_mask
Add crypto_usage_masks argument to pie Create operation
2017-04-21 11:01:55 -04:00
Peter Hamilton fda5e32fa0 Merge pull request #271 from vbnmmnbv/revoke_server
Add initial Revoke operation support for server.
2017-04-21 10:31:09 -04:00
Hao Shen 74075d502c Add Revoke operation support for pie client 2017-04-20 10:19:10 -07:00
Hao Shen a2b7194c08 Add crypto_usage_masks argument to pie Create operation 2017-04-19 21:07:32 -07:00
Hao Shen 0229a83acf Add initial Revoke operation support for server.
See the TODO in _process_revoke for more info.
2017-04-19 15:27:51 -07:00
Peter Hamilton e26e0748af Merge pull request #280 from vbnmmnbv/api_activate_locate_mac
Add the missing locate/activate KmipClient abstractmethod definition
2017-04-19 18:07:56 -04:00
Peter Hamilton 5678c21903 Merge pull request #273 from vbnmmnbv/mac_state_permission_server
Add state/crypto usage mask checks for MAC operation
2017-04-19 18:02:46 -04:00
Hao Shen ec4dae707c Add the missing locate/activate KmipClient abstractmethod definition 2017-04-14 11:19:50 -07:00
Peter Hamilton fae811528b Fixing stringent uid value checks in the ProxyKmipClient
This change loosens the input requirements for ProxyKmipClient
operations that accept a secret UID. Operations like Get and
Destroy used to require a string value but are allowed in the
KMIP specification to take no value at all. This change updates
the ProxyKmipClient to properly reflect the specification. The
underlying KMIPProxy client is mostly unchanged.

Closes #261
2017-04-12 17:41:13 -04:00
Hao Shen a0673dc111 Add state/crypto usage mask checks for MAC operation 2017-04-11 18:16:54 -07:00
Peter Hamilton 1d2a337ee0 Update the server Query results to match current features
This change updates the server results returned by the Query
operation to match the current set of supported features. The tests
for Query have been updated to better reflect testing across KMIP
versions.
2017-04-11 16:43:43 -04:00
Peter Hamilton 28e1e809d1 Merge pull request #275 from vbnmmnbv/KmipOperationFailure
Modify KmipOperationFailure to expose status/reason/message attributes
2017-04-06 08:54:16 -04:00
Hao Shen 16d79283f2 Modify KmipOperationFailure to expose status/reason/message attributes 2017-04-04 11:36:05 -07:00
Hao Shen 5967b55148 Fixing stringent argument checks for MAC operation 2017-03-30 14:32:42 -07:00
Hao Shen eda50d657a fix activate uid none check 2017-03-29 20:23:06 -07:00
Hao Shen de1d9c5646 Add Activate operation support for pie client 2017-03-29 11:55:48 -07:00
Peter Hamilton 5fc2e26527 Merge pull request #259 from OpenKMIP/maint/cleanup-old-server-code
Removing deprecated server code and supporting infrastructure
2017-03-28 09:37:10 -04:00
Peter Hamilton cbcb5b97bf Merge pull request #263 from vbnmmnbv/locate_pie
Add Locate operation support for pie client
2017-02-15 10:40:15 -05:00
Hao Shen b8b2d43347 Add minimum Locate operation support for server.
Currently it will return all the existing managed objects with the restriction of operation
policy only. No other filterings.

Closes #258
2017-02-14 18:09:10 -08:00
Hao Shen f0934fd08a Add Locate operation support for pie client 2017-02-14 17:59:52 -08:00
Peter Hamilton c584ac0cb5 Removing deprecated server code and supporting infrastructure
This change removes the original KMIPServer implementation, along
with all supporting classes. The KmipServer implementation is the
only supported server implementation going forward.
2017-02-08 15:29:10 -05:00
Peter Hamilton d9cf4c148a Merge pull request #256 from vbnmmnbv/server
Add MAC operation support for server
2017-02-03 12:11:41 -05:00
Hao Shen ac1206082c Add MAC operation support for server 2017-02-02 13:25:22 -08:00
Peter Hamilton 7fca09fa75 Merge pull request #254 from vbnmmnbv/client
Add MAC operation support at client side
2017-02-02 13:09:51 -05:00
Hao Shen 2d45f33d43 Add MAC operation support for client 2017-01-31 14:48:19 -08:00
Peter Hamilton 84fe76e15d Merge pull request #255 from vbnmmnbv/payload
Add necessary objects/attributes and payloads for MAC operation
2017-01-31 11:11:54 -05:00
Hao Shen a2696b722f Add necessary objects/attributes and payloads for MAC operation 2017-01-30 14:50:40 -08:00
Peter Hamilton 4dbf6b8e79 Merge pull request #246 from OpenKMIP/maint/drop-support-for-python2.6
Remove support for Python2.6
2017-01-30 09:29:47 -05:00
Hao Shen e8b63eb9d3 Add MAC operation support in cryptography engine 2017-01-25 13:10:41 -08:00
Peter Hamilton 47898365ba Fixing the KMIPProxy CreateKeyPair demo script
This change fixes a bug with the CreateKeyPair demo script for the
KMIPProxy client. The key pair name was never included with the
create request due to variable name overuse. This change fixes the
variable names thereby fixing the demo script.

Fixes #249
2017-01-10 13:37:50 -05:00
Peter Hamilton c5ca3297f3 Remove support for Python2.6
This change removes PyKMIP support for Python2.6. The last release
of Python2.6 occurred in October 2013, over 3 years ago. It also
does not support security features needed to use PyKMIP according
to best practices. This change drops tox and TravisCI settings for
Python2.6 and updates setup to no longer categorize the library as
Python2.6 compliant. The README has been updated accordingly.

Closes #116
2017-01-09 14:53:25 -05:00
Peter Hamilton 57c703c52f Refactor access control enforcement in the server
This change restructures how access controls are enforced for
different server operations, pulling common code into a shared
method for reuse. The server unit tests have been updated to
reflect this change.
2017-01-09 10:34:14 -05:00
Peter Hamilton 1bd5366a62 Adding support for the InitialDate attribute
This change updates the server and managed object set to support
the InitialDate attribute. The InitialDate is set when the Create,
CreateKeyPair, and Register operations are invoked and can be
listed and retrieved with the GetAttributeList and GetAttributes
operations respectively. The server unit tests have been updated
to reflect these changes.
2017-01-08 12:07:22 -05:00
Peter Hamilton 089d126b04 Adding server support for the GetAttributeList operation
This change adds support for the GetAttributeList operation. The
user can specify the ID of a managed object and get back a list
containing the names of all attributes currently set on the object.
The user can also omit the ID and the server will default to using
the ID placeholder for the object ID. New server tests have been
added to cover this feature. The GetAttributeList payloads have
also been updated for consistency with other payloads, requiring
minor updates in other clients and unit tests.
2017-01-05 18:43:11 -05:00
Peter Hamilton 28209bd60a Fixes a bug with socket interrupt handling under Python3.5
This change fixes a bug introduced with the addition of Python3.5
support. In Python3.5, SIGINT is silently ignored for system calls
(e.g., socket.accept) if the SIGINT signal handler does not raise
an exception. This causes the server to delay shutdown when
receiving SIGINT until after a new connection has been made. This
change updates the server's SIGINT signal handler to raise the
correct exception and updates the error handling code while serving
connections to account for this change in SIGINT processing. This
allows the server to shutdown immediately upon receiving SIGINT.
The server unit tests are updated to account for this change.
2017-01-04 16:05:45 -05:00
Peter Hamilton bbc2d8e58a Merge pull request #238 from cfs-pure/master
Unit test fixes
2017-01-04 13:24:24 -05:00
Charles Stephens 5be11db648 Unit test fixes
Fix unittests for compatibility between Python 2 and 3.
2017-01-04 10:04:10 -08:00
Peter Hamilton 36f0583adf Fixes a mismapped polymorphic identity for X509Certificate objects
This change updates the polymorphic identity used by
X509Certificate objects. The original identity was already used by
the base Certificate object, causing sqlalchemy to raise a warning
when used. This change resolves the identity reassignment and
prevents the warning from being displayed.
2017-01-04 12:01:39 -05:00
Peter Hamilton 239ec7102d Fixes how open is mocked in the server test suite
This change updates how the built-in open function is mocked in
the PyKMIP server test suite. On some platforms the old approach
was insufficient. This change explicitly references the builtins
module for Python3+, removing the old module-based mock.
2017-01-04 11:29:30 -05:00
Peter Hamilton b1f73d811c Fixing a bug with multithreading support with the SQLite backend
This change fixes a bug that could occur when accessing the server
with multiple threads or processes. The SQLite backend by default
does not support multithreading. This change updates how the
SQLite backend is instantiated, preventing error generation when
using multiple clients simultaenously. The server unit test suite
has been updated to cover the change.
2016-12-17 14:57:38 -05:00
Peter Hamilton 0df3866837 PyKMIP - Release 0.6.0
This update includes new operations and features for the clients
and server, in addition to other minor updates and bug fixes:

* Add support for Python 3.5
* Add support for the State and OperationPolicyName attributes
* Add server support for the Activate and GetAttributes operations
* Add server support for certificate-based client authentication
* Add server support for object access control via operation policy
* Add server support for loading of user-defined operation policies
* Add client support for the GetAttributes operation
* Update clients to support operation policy names with objects
* Update ProxyKmipClient to support names when creating new objects
* Remove coveralls integration
* Fix bug with server termination on missing request credential
* Fix bug with closing the client while unconnected to a server
* Fix bug with default values overriding server conf file settings
* Fix bug with early server termination on bad client certificates
* Fix bug with deprecated usage of the bandit config file
* Fix bug with ProxyKmipClient registering unset object attributes
2016-12-14 14:55:58 -05:00
Peter Hamilton 065cc0cec1 Updating server to enable the Activate operation
This change updates the PyKMIP server to enable the Activate
operation. Server unit tests are updated to account for this
change.
2016-12-07 19:27:05 -05:00
Peter Hamilton 131addf967 Merge pull request #231 from OpenKMIP/bug/handle-missing-object-attribute
Updating the server to handle errors during attribute lookup
2016-12-07 19:25:21 -05:00