VirtualBox

source: vbox/trunk/src/libs/openssl-3.3.2/fuzz/v3name.c@ 108403

最後變更 在這個檔案從108403是 108206,由 vboxsync 提交於 5 週 前

openssl-3.3.2: Exported all files to OSE and removed .scm-settings ​bugref:10757

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.1 KB
 
1/*
2 * Copyright 2012-2023 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <string.h>
11#include <openssl/e_os2.h>
12#include <openssl/x509.h>
13#include <openssl/x509v3.h>
14#include "internal/nelem.h"
15#include "fuzzer.h"
16
17int FuzzerInitialize(int *argc, char ***argv)
18{
19 return 1;
20}
21
22int FuzzerTestOneInput(const uint8_t* data, size_t size){
23 GENERAL_NAME *namesa;
24 GENERAL_NAME *namesb;
25
26 const unsigned char *derp = data;
27 /*
28 * We create two versions of each GENERAL_NAME so that we ensure when
29 * we compare them they are always different pointers.
30 */
31 namesa = d2i_GENERAL_NAME(NULL, &derp, size);
32 derp = data;
33 namesb = d2i_GENERAL_NAME(NULL, &derp, size);
34 GENERAL_NAME_cmp(namesa, namesb);
35 if (namesa != NULL)
36 GENERAL_NAME_free(namesa);
37 if (namesb != NULL)
38 GENERAL_NAME_free(namesb);
39 return 0;
40}
41
42void FuzzerCleanup(void)
43{
44}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette