Update - OpenSSL 1.1.1-pre7-dev

This commit is contained in:
2018-05-23 23:52:41 +09:00
parent e8a0afd4a0
commit ef253190c7
624 changed files with 189420 additions and 8064 deletions
+5
View File
@@ -848,6 +848,8 @@ OBJ_id_camellia256_wrap="\x2A\x83\x08\x8C\x9A\x4B\x3D\x01\x01\x03\x04"
OBJ_anyExtendedKeyUsage="\x55\x1D\x25\x00"
OBJ_mgf1="\x2A\x86\x48\x86\xF7\x0D\x01\x01\x08"
OBJ_rsassaPss="\x2A\x86\x48\x86\xF7\x0D\x01\x01\x0A"
OBJ_aes_128_xts="\x2B\x6F\x02\x8C\x53\x00\x01\x01"
OBJ_aes_256_xts="\x2B\x6F\x02\x8C\x53\x00\x01\x02"
OBJ_rsaesOaep="\x2A\x86\x48\x86\xF7\x0D\x01\x01\x07"
OBJ_dhpublicnumber="\x2A\x86\x48\xCE\x3E\x02\x01"
OBJ_brainpoolP160r1="\x2B\x24\x03\x03\x02\x08\x01\x01\x01"
@@ -1042,3 +1044,6 @@ OBJ_uacurve6="\x2A\x86\x24\x02\x01\x01\x01\x01\x03\x01\x01\x02\x06"
OBJ_uacurve7="\x2A\x86\x24\x02\x01\x01\x01\x01\x03\x01\x01\x02\x07"
OBJ_uacurve8="\x2A\x86\x24\x02\x01\x01\x01\x01\x03\x01\x01\x02\x08"
OBJ_uacurve9="\x2A\x86\x24\x02\x01\x01\x01\x01\x03\x01\x01\x02\x09"
OBJ_ieee="\x2B\x6F"
OBJ_ieee_siswg="\x2B\x6F\x02\x8C\x53"
OBJ_sm2="\x2A\x81\x1C\xCF\x55\x01\x82\x2D"
+70 -15
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL licenses, (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +16,47 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <openssl/crypto.h>
#include "fuzzer.h"
#include "internal/o_dir.h"
#if defined(_WIN32) && defined(_MAX_PATH)
# define PATH_MAX _MAX_PATH
#endif
#ifndef PATH_MAX
# define PATH_MAX 4096
#endif
# if !defined(S_ISREG)
# define S_ISREG(m) ((m) & S_IFREG)
# endif
static void testfile(const char *pathname)
{
struct stat st;
FILE *f;
unsigned char *buf;
size_t s;
if (stat(pathname, &st) < 0 || !S_ISREG(st.st_mode))
return;
printf("# %s\n", pathname);
fflush(stdout);
f = fopen(pathname, "rb");
if (f == NULL)
return;
buf = malloc(st.st_size);
if (buf != NULL) {
s = fread(buf, 1, st.st_size, f);
OPENSSL_assert(s == (size_t)st.st_size);
FuzzerTestOneInput(buf, s);
free(buf);
}
fclose(f);
}
int main(int argc, char **argv) {
int n;
@@ -26,21 +64,38 @@ int main(int argc, char **argv) {
FuzzerInitialize(&argc, &argv);
for (n = 1; n < argc; ++n) {
struct stat st;
FILE *f;
unsigned char *buf;
size_t s;
size_t dirname_len = strlen(argv[n]);
const char *filename = NULL;
char *pathname = NULL;
OPENSSL_DIR_CTX *ctx = NULL;
int wasdir = 0;
stat(argv[n], &st);
f = fopen(argv[n], "rb");
if (f == NULL)
continue;
buf = malloc(st.st_size);
s = fread(buf, 1, st.st_size, f);
OPENSSL_assert(s == (size_t)st.st_size);
FuzzerTestOneInput(buf, s);
free(buf);
fclose(f);
/*
* We start with trying to read the given path as a directory.
*/
while ((filename = OPENSSL_DIR_read(&ctx, argv[n])) != NULL) {
wasdir = 1;
if (pathname == NULL) {
pathname = malloc(PATH_MAX);
if (pathname == NULL)
break;
strcpy(pathname, argv[n]);
#ifdef __VMS
if (strchr(":<]", pathname[dirname_len - 1]) == NULL)
#endif
pathname[dirname_len++] = '/';
pathname[dirname_len] = '\0';
}
strcpy(pathname + dirname_len, filename);
testfile(pathname);
}
OPENSSL_DIR_end(&ctx);
/* If it wasn't a directory, treat it as a file instead */
if (!wasdir)
testfile(argv[n]);
free(pathname);
}
FuzzerCleanup();