-
Notifications
You must be signed in to change notification settings - Fork 656
FFI: Enumeration of entries in an X.509 CRL #5220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,7 @@ enum BOTAN_FFI_ERROR /* NOLINT(*-enum-size,*-use-enum-class) */ { | |
| BOTAN_FFI_ERROR_KEY_NOT_SET = -33, | ||
| BOTAN_FFI_ERROR_INVALID_KEY_LENGTH = -34, | ||
| BOTAN_FFI_ERROR_INVALID_OBJECT_STATE = -35, | ||
| BOTAN_FFI_ERROR_OUT_OF_RANGE = -36, | ||
|
|
||
| BOTAN_FFI_ERROR_NOT_IMPLEMENTED = -40, | ||
| BOTAN_FFI_ERROR_INVALID_OBJECT = -50, | ||
|
|
@@ -2238,6 +2239,7 @@ BOTAN_FFI_EXPORT(2, 8) const char* botan_x509_cert_validation_status(int code); | |
| **************************/ | ||
|
|
||
| typedef struct botan_x509_crl_struct* botan_x509_crl_t; | ||
| typedef struct botan_x509_crl_entry_struct* botan_x509_crl_entry_t; | ||
|
|
||
| BOTAN_FFI_EXPORT(2, 13) int botan_x509_crl_load_file(botan_x509_crl_t* crl_obj, const char* crl_path); | ||
| BOTAN_FFI_EXPORT(2, 13) | ||
|
|
@@ -2254,6 +2256,40 @@ BOTAN_FFI_EXPORT(2, 13) int botan_x509_crl_destroy(botan_x509_crl_t crl); | |
| */ | ||
| BOTAN_FFI_EXPORT(2, 13) int botan_x509_is_revoked(botan_x509_crl_t crl, botan_x509_cert_t cert); | ||
|
|
||
| /** | ||
| * Allows iterating all entries of the CRL. | ||
| * | ||
| * @param crl the CRL whose entries should be listed | ||
| * @param index the index of the CRL entry to return | ||
| * @param entry an object handle containing the CRL entry data | ||
| * | ||
| * @returns BOTAN_FFI_ERROR_OUT_OF_RANGE if the given @p index is out of range of | ||
| * the CRL entry list. | ||
| */ | ||
| BOTAN_FFI_EXPORT(3, 11) | ||
| int botan_x509_crl_entries(botan_x509_crl_t crl, size_t index, botan_x509_crl_entry_t* entry); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussion in #5230 (comment) |
||
|
|
||
| /** | ||
|
reneme marked this conversation as resolved.
|
||
| * Return the revocation reason code for the given CRL @p entry. | ||
| * See RFC 5280 - 5.3.1 for possible reason codes. | ||
| */ | ||
| BOTAN_FFI_EXPORT(3, 11) int botan_x509_crl_entry_reason(botan_x509_crl_entry_t entry, int* reason_code); | ||
|
|
||
| /** | ||
| * Return the revocation date for the given CRL @p entry as time since epoch | ||
| * in seconds. | ||
| */ | ||
| BOTAN_FFI_EXPORT(3, 11) | ||
| int botan_x509_crl_entry_revocation_date(botan_x509_crl_entry_t entry, uint64_t* time_since_epoch); | ||
|
|
||
| /** | ||
| * View the serial number associated with the given CRL @p entry. | ||
| */ | ||
| BOTAN_FFI_EXPORT(3, 11) | ||
| int botan_x509_crl_entry_view_serial_number(botan_x509_crl_entry_t entry, botan_view_ctx ctx, botan_view_bin_fn view); | ||
|
Comment on lines
+2285
to
+2289
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the same argument as in #5221 regarding OIDs and also this explicit remark by @arckoor, we should consider adding an "overload" to export the CRL entry serial as a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There may be an argument for also adding an MPI view function for the existing X509 cert serial
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll combine those in a follow-up PR after merging the current stack of changes. |
||
|
|
||
| BOTAN_FFI_EXPORT(3, 11) int botan_x509_crl_entry_destroy(botan_x509_crl_entry_t entry); | ||
|
|
||
| /** | ||
| * Different flavor of `botan_x509_cert_verify`, supports revocation lists. | ||
| * CRLs are passed as an array, same as intermediates and trusted CAs | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.