Skip to content

Bug: wh_server_cert calls don't support local cache #312

Description

@DrKatieL

The issue:
This is issue is widespread throughout wh_server_cert.c. I'm going to walk through one function but search for "server->nvm,". for other instances.
wh_Server_CertReadTrusted() needs to get a root certificate out of NVM. If key wrapping is enabled, this is only available to the server via the cache. In these builds the server will/may have two caches, a global one (accessible via server->nvm->globalCache) and a local one (accessible by server->localCache. wh_Server_CertReadTrusted() calls wh_Nvm_GetMetadata and wh_Nvm_Read on server->nvm. If the key wrap is using a local cache (the safer and default option) these calls will obviously fail as the call has no access to a local cache.

The fix:
This suggestion should obviously be verified for architectural correctness and unintended security side effects before adoption. The certs can be accessed via wh_Server_KeystoreReadKey and other general keystore calls which correctly handle caches and reduces code duplication. Alternatively, wh_Server_CertReadTrusted and other calls in the certificate manager can be rewritten to use logic more similar to that in the general keystore and accept the entire server object as a parameter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions