Skip to content

Error reporting and reason table generation for providers #9003

@levitte

Description

@levitte

NOTE: this is an age old issue that has existed since the beginning of ENGINEs

Providers will have to be able to report errors, and we already have the mechanisms for doing so "the OpenSSL way" via put_error and add_error_vdata upcalls. However, is that sufficient?

As everyone (or well, some at least), our error codes contain quite a lot of information:

  1. 8-bit "library" code (in terms we tend to use today, that's sub-system code)
  2. 12-bit function code
  3. 12-bit reason code

How much of this is needed for a provider? Logically, the "library" code should be the same for a whole provider, and the value function codes have been questioned before...
Reason codes and associated printable strings are another matter, they are fairly universally accepted error reporting tools (see errno and strerror on Unix, or corresponding on other platforms).

Furthermore, reason strings in OpenSSL is a fairly complicated matter, and is done by using util/mkerr.pl, which scans the source for function code macros and reason code macros, and generates header files to define those macros (give them numbers) and source files for the associated strings. However, that script is internal and is never made publicly available (which has always been a problem for any ENGINE author).

So the question is, how can we make it simpler for provider authors? Can we make it in such a way that they just need to provide reason codes and strings as a simple array of < number, string > tuples, and then report the reason numbers as they see fit? As an alternative, should providers offer a strerror like function for libcrypto to call when it needs a string?

Metadata

Metadata

Assignees

Labels

branch: masterApplies to master branchtriaged: featureThe issue/pr requests/adds a feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions