X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fx509%2Fx509_minimal.t0;h=7b7b2e6106fe7a009aec35e497d525e8d0c49521;hp=f8c7f259d648b8036660c55b1f1b0806abb84e68;hb=3f00688b9d9f483a6ca97e659eea104995ea15b7;hpb=9e71c0673a9f46f82e43125919619f296698292e diff --git a/src/x509/x509_minimal.t0 b/src/x509/x509_minimal.t0 index f8c7f25..7b7b2e6 100644 --- a/src/x509/x509_minimal.t0 +++ b/src/x509/x509_minimal.t0 @@ -341,6 +341,42 @@ eqbigint(const unsigned char *b1, size_t len1, return memcmp(b1, b2, len1) == 0; } +/* + * Compare two strings for equality, in a case-insensitive way. This + * function handles casing only for ASCII letters. + */ +static int +eqnocase(const void *s1, const void *s2, size_t len) +{ + const unsigned char *buf1, *buf2; + + buf1 = s1; + buf2 = s2; + while (len -- > 0) { + int x1, x2; + + x1 = *buf1 ++; + x2 = *buf2 ++; + if (x1 >= 'A' && x1 <= 'Z') { + x1 += 'a' - 'A'; + } + if (x2 >= 'A' && x2 <= 'Z') { + x2 += 'a' - 'A'; + } + if (x1 != x2) { + return 0; + } + } + return 1; +} + +static int verify_signature(br_x509_minimal_context *ctx, + const br_x509_pkey *pk); + +} + +postamble { + /* * Verify the signature on the certificate with the provided public key. * This function checks the public key type with regards to the expected @@ -390,35 +426,6 @@ verify_signature(br_x509_minimal_context *ctx, const br_x509_pkey *pk) } } -/* - * Compare two strings for equality, in a case-insensitive way. This - * function handles casing only for ASCII letters. - */ -static int -eqnocase(const void *s1, const void *s2, size_t len) -{ - const unsigned char *buf1, *buf2; - - buf1 = s1; - buf2 = s2; - while (len -- > 0) { - int x1, x2; - - x1 = *buf1 ++; - x2 = *buf2 ++; - if (x1 >= 'A' && x1 <= 'Z') { - x1 += 'a' - 'A'; - } - if (x2 >= 'A' && x2 <= 'Z') { - x2 += 'a' - 'A'; - } - if (x1 != x2) { - return 0; - } - } - return 1; -} - } cc: read8-low ( -- x ) {