History log of /haiku/src/kits/app/KeyStore.cpp
Revision Date Author Comments
# c1ad322d 09-Feb-2024 Ilmari "ilzu" Siiteri <ilzu.siiteri@gmail.com>

BKeyStore: Fix code to match documentation

Make secondary identifier mandatory on GetKey convience methods that secondary identifier as parameter (and not the secondaryIdentifierOptional bool)

Fixes #18776

Change-Id: I1ae3c9c0eb80a16e18a74835d7915dfa5efbb665
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7398
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 4e66f871 31-Mar-2013 Michael Lotz <mmlr@mlotz.ch>

Launch the keystore_server on demand from BKeyStore.

This allows leaving the keystore_server closed as long as it isn't
used and still avoids having to launch it manually.


# 4a0460a9 25-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Add generic unlock key setting and removal.

* Replace {Set|Remove}MasterKey() by generic {Set|Remove}UnlockKey()
that works on a keyring.
* Implement {Set|Remove}MasterUnlockKey() on top of that.
* Rename the commands and constants accrodingly.
* Implement setting and removing keyring unlock keys.


# d4d6d123 25-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Don't require a key when creating a new keyring.

There will be key setting/removal functions so the step of adding the
keyring and setting a key on it can be done individually.


# f8ccc323 24-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Remove the API part of the concept of apps per key.

The application access concept is on the keyring level only for now.
Generally it probably would get pretty complicated and therefore harder
to use when application access needs to be granted on a per key basis.


# c8ae843f 24-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Rename keyring "access/revoke" to "unlock/lock".

The unlock/lock concept just seems easier to grasp and is used in
various similar tools as well.


# 64ca113f 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Add keyring specific versions of the *Application() methods.


# 51ab46a8 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Remove the purpose argument from all GetKey() variants.

The type is relevant and required as it determines the type of the
handed in key. The purpose however isn't actually needed and rather
inconvenient to get by depending on the situation.


# 94f897de 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Make Flatten/Unflatten public and remove IsRegistered().

The BKey doesn't know anything about the keyring concept, so the
registered info isn't really useful. May be re-added later with
keyring info as well.


# 5d4a0da4 06-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Remove unneeded master access revoke command.

Revoking master access currently simply means to revoke access
to the default keyring.


# 95eee1a3 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Make the keystore_server keyring aware.

* Move the *Key() functions into a Keyring class.
* Retrieve and select the right keyring for various commands.
* Implement adding/removing/enumerating keyrings.
* Rework the keystore database read/write to work with keyrings.
* Sync BKeyStore::IsKeyringAccessible() with the changed message.
* Remove leftover template code from registrar.


# 37ac7cb2 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Update the cookie from the reply message.


# 005a15bb 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Move keystore message constants and use a messenger.

* The keystore backend will (at least for the time being) reside in a
separate server. This one can be reached via normal messaging, so use
a BMessenger for sending key messages.
* Move the message constants from RegistrarDefs.h into a new
KeyStoreDefs.h that also contains the server signature.
* Update the message constants to reflect the new situation.


# 1c399649 03-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Implement all KeyStore methods except for password generation.

* Add all relevant message constants.
* Implement the messaging to send/retrieve key info.
* Implement _Flatten/_Unflatten for sending flat BKey objects.
* Remove application list from BKey, the key can't only differ by
allowed applications as the identifiers would still collide, so the
comparison isn't needed to uniquely identify the key. The applications
can be enumerated via the BKeyStore instead.


# b7398289 03-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Rename [Un]Register* functions to Add/Remove*.


# dc1acef8 22-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Flesh out the API and implement stubs.

* Modified the API greatly to be based on BKey* instead of BPassword*.
* Added BKeyPurpose and used it instead of BKeyType. It is supposed to
indicate the purpose of a key so that an app can look up keys on a
more granular level. The BKeyType on the other hand actually
identifies the type (i.e. subclass of BKey) so an app knows how to
handle a given key or may only enumerate/use keys it is compatible
with.
* Made everything based on a raw data buffer for now, only BPasswordKey
is implemented yet which stores the (0 terminated) string into that
data buffer.
* Removed the additional data BMessage as I don't yet see where it fits
in. While I could imagine adding meta data to a key may be nice it
might be an interoperability concern when keys are shared by
different apps.
* Moved the app functions to the keystore as per the TODO, but not sure
how to actually implement them.


# 3b3884d9 16-Nov-2011 Michael Lotz <mmlr@mlotz.ch>

KeyStore and Key interface/stubs draft per Axel Dörfler.

A draft API and (mostly) stubs to back it up. Initial import of yet
unmodified sources.


# 4e66f871e58574af7ba13b6af259d4dedf58095e 31-Mar-2013 Michael Lotz <mmlr@mlotz.ch>

Launch the keystore_server on demand from BKeyStore.

This allows leaving the keystore_server closed as long as it isn't
used and still avoids having to launch it manually.


# 4a0460a9bc02ca100b7b7de2f7b04e77ee75593f 25-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Add generic unlock key setting and removal.

* Replace {Set|Remove}MasterKey() by generic {Set|Remove}UnlockKey()
that works on a keyring.
* Implement {Set|Remove}MasterUnlockKey() on top of that.
* Rename the commands and constants accrodingly.
* Implement setting and removing keyring unlock keys.


# d4d6d1239322eeb4c100489eb76ed63afde449d6 25-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Don't require a key when creating a new keyring.

There will be key setting/removal functions so the step of adding the
keyring and setting a key on it can be done individually.


# f8ccc323268f9ad9f2925d06ac5bf281395ca26a 24-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Remove the API part of the concept of apps per key.

The application access concept is on the keyring level only for now.
Generally it probably would get pretty complicated and therefore harder
to use when application access needs to be granted on a per key basis.


# c8ae843f3dcba6c16eda5d2b5db1f981ee69f448 24-Jun-2012 Michael Lotz <mmlr@mlotz.ch>

Rename keyring "access/revoke" to "unlock/lock".

The unlock/lock concept just seems easier to grasp and is used in
various similar tools as well.


# 64ca113fe04c0f0380fdb7df17c412de694e74c2 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Add keyring specific versions of the *Application() methods.


# 51ab46a83c98631702ef1b4734af7db7ec0672ab 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Remove the purpose argument from all GetKey() variants.

The type is relevant and required as it determines the type of the
handed in key. The purpose however isn't actually needed and rather
inconvenient to get by depending on the situation.


# 94f897deeaa6eda4b7982a958287c5c8fa2ce435 07-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Make Flatten/Unflatten public and remove IsRegistered().

The BKey doesn't know anything about the keyring concept, so the
registered info isn't really useful. May be re-added later with
keyring info as well.


# 5d4a0da4557c1bbd3d8463201bc3f6ab93b06ae6 06-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Remove unneeded master access revoke command.

Revoking master access currently simply means to revoke access
to the default keyring.


# 95eee1a36302940cff0bcf81d943b9d59c60bac2 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Make the keystore_server keyring aware.

* Move the *Key() functions into a Keyring class.
* Retrieve and select the right keyring for various commands.
* Implement adding/removing/enumerating keyrings.
* Rework the keystore database read/write to work with keyrings.
* Sync BKeyStore::IsKeyringAccessible() with the changed message.
* Remove leftover template code from registrar.


# 37ac7cb2de2781edeb00329881d012ba5761bb1a 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Update the cookie from the reply message.


# 005a15bbcd7fe2f63477eea4b111711c44e171aa 04-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Move keystore message constants and use a messenger.

* The keystore backend will (at least for the time being) reside in a
separate server. This one can be reached via normal messaging, so use
a BMessenger for sending key messages.
* Move the message constants from RegistrarDefs.h into a new
KeyStoreDefs.h that also contains the server signature.
* Update the message constants to reflect the new situation.


# 1c3996496b06a2da3ae25c358336302dfbce7ddb 03-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Implement all KeyStore methods except for password generation.

* Add all relevant message constants.
* Implement the messaging to send/retrieve key info.
* Implement _Flatten/_Unflatten for sending flat BKey objects.
* Remove application list from BKey, the key can't only differ by
allowed applications as the identifiers would still collide, so the
comparison isn't needed to uniquely identify the key. The applications
can be enumerated via the BKeyStore instead.


# b73982892dde263a77608f219c3e02c48790f0c5 03-Jan-2012 Michael Lotz <mmlr@mlotz.ch>

Rename [Un]Register* functions to Add/Remove*.


# dc1acef865f290e8d565f078fc78be69991b5c10 22-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Flesh out the API and implement stubs.

* Modified the API greatly to be based on BKey* instead of BPassword*.
* Added BKeyPurpose and used it instead of BKeyType. It is supposed to
indicate the purpose of a key so that an app can look up keys on a
more granular level. The BKeyType on the other hand actually
identifies the type (i.e. subclass of BKey) so an app knows how to
handle a given key or may only enumerate/use keys it is compatible
with.
* Made everything based on a raw data buffer for now, only BPasswordKey
is implemented yet which stores the (0 terminated) string into that
data buffer.
* Removed the additional data BMessage as I don't yet see where it fits
in. While I could imagine adding meta data to a key may be nice it
might be an interoperability concern when keys are shared by
different apps.
* Moved the app functions to the keystore as per the TODO, but not sure
how to actually implement them.


# 3b3884d9eec9b931efab12d5b2b47d7e33827a65 16-Nov-2011 Michael Lotz <mmlr@mlotz.ch>

KeyStore and Key interface/stubs draft per Axel Dörfler.

A draft API and (mostly) stubs to back it up. Initial import of yet
unmodified sources.