diff options
| author | Dr. David von Oheimb <[email protected]> | 2025-04-26 14:20:20 +0200 |
|---|---|---|
| committer | Dr. David von Oheimb <[email protected]> | 2026-09-10 15:32:49 +0200 |
| commit | 5e53ea9531d09a5c805b8bb4ffe4ac8b9e810609 (patch) | |
| tree | 0b4da72a655dede18d7e921e2807dc2c5973d218 /include | |
| parent | 90-test_store.t: fix outdated comment on relative file: path (diff) | |
| download | openssl-5e53ea9531d09a5c805b8bb4ffe4ac8b9e810609.tar.gz openssl-5e53ea9531d09a5c805b8bb4ffe4ac8b9e810609.zip | |
ossl_store_register_loader_int(): refactor by extracting the macro OSSL_SKIP_SCHEME()
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Simo Sorce <[email protected]>
MergeDate: Thu Sep 10 13:32:55 2026
(Merged from https://github.com/openssl/openssl/pull/27507)
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/internal/common.h b/include/internal/common.h index d81a04333c4..6834b595a58 100644 --- a/include/internal/common.h +++ b/include/internal/common.h @@ -13,6 +13,7 @@ #include <stdlib.h> #include <string.h> +#include "crypto/ctype.h" #include "openssl/configuration.h" #include "internal/e_os.h" /* ossl_inline in many files */ @@ -69,6 +70,13 @@ __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr, (HAS_CASE_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0) /* Check if the string literal |suffix| is a case-insensitive suffix of |str| */ #define HAS_CASE_SUFFIX(str, suffix) (strlen(str) < sizeof(suffix) - 1 ? 0 : OPENSSL_strcasecmp(str + strlen(str) - sizeof(suffix) + 1, suffix "") == 0) +/* Advance string pointer past scheme acc to RFC 3986: ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) */ +#define OSSL_SKIP_SCHEME(s) \ + do { \ + if (ossl_isalpha(*(s))) \ + while (*(s) != '\0' && (ossl_isalnum(*(s)) || strchr("+-.", *(s)) != NULL)) \ + (s)++; \ + } while (0) /* * Use this inside a union with the field that needs to be aligned to a |
