New Makefile structure; added compatibility with Windows + Visual C + nmake.

This commit is contained in:
Thomas Pornin 2017-01-22 20:00:29 +01:00
parent 2f454aad57
commit 3f00688b9d
29 changed files with 2240 additions and 1069 deletions

View file

@ -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 ) {