From 1bc9c4c8c803b40fe01bdb3ab827669896c4c150 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 7 Aug 2020 22:47:15 +0200 Subject: [PATCH] Make entry points mandatory in capabilities Inferring entry points from algorithms is nice in that it makes capability specifications shorter and less redundant, but that's not really important. It also makes capabilities more fragile: if the core starts supporting new mechanisms based on the same algorithm (for example, adding hash-and-sign when only sign-the-hash existed before), a driver only supporting the old mechanisms would fail at build time. So make entry points mandatory. This has the benefit of making the semantics of capabilities easier to describe. Signed-off-by: Gilles Peskine --- docs/proposed/psa-driver-interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/proposed/psa-driver-interface.md b/docs/proposed/psa-driver-interface.md index cc760d44c..32427ae68 100644 --- a/docs/proposed/psa-driver-interface.md +++ b/docs/proposed/psa-driver-interface.md @@ -83,7 +83,7 @@ A capability declares a family of functions that the driver implements for a cer A capability is a JSON object containing the following properties: -* `"entry_points"` (optional, list of strings). Each element is the name of a [driver entry point](#driver-entry-point) or driver entry point family. An entry point is a function defined by the driver. If specified, the core will invoke this capability of the driver only when performing one of the specified operations. If omitted, the `"algorithms"` property is mandatory and the core will invoke this capability of the driver for all operations that are applicable to the specified algorithms. The driver must implement all the specified or implied entry points, as well as the types if applicable. +* `"entry_points"` (mandatory, list of strings). Each element is the name of a [driver entry point](#driver-entry-point) or driver entry point family. An entry point is a function defined by the driver. If specified, the core will invoke this capability of the driver only when performing one of the specified operations. The driver must implement all the specified entry points, as well as the types if applicable. * `"algorithms"` (optional, list of strings). Each element is an [algorithm specification](#algorithm-specifications). If specified, the core will invoke this capability of the driver only when performing one of the specified algorithms. If omitted, the core will invoke this capability for all applicable algorithms. * `"key_types"` (optional, list of strings). Each element is a [key type specification](#key-type-specifications). If specified, the core will invoke this capability of the driver only for operations involving a key with one of the specified key types. If omitted, the core will invoke this capability of the driver for all applicable key types. * `"key_sizes"` (optional, list of integers). If specified, the core will invoke this capability of the driver only for operations involving a key with one of the specified key sizes. If omitted, the core will invoke this capability of the driver for all applicable key sizes. Key sizes are expressed in bits.