~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to src/fuzzer/pkcs8.cpp

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* (C) 2015,2016 Jack Lloyd
 
3
*
 
4
* Botan is released under the Simplified BSD License (see license.txt)
 
5
*/
 
6
 
 
7
#include "fuzzers.h"
 
8
#include <botan/pk_keys.h>
 
9
#include <botan/pkcs8.h>
 
10
#include <botan/data_src.h>
 
11
 
 
12
void fuzz(const uint8_t in[], size_t len)
 
13
   {
 
14
   try
 
15
      {
 
16
      Botan::DataSource_Memory input(in, len);
 
17
      Botan::Null_RNG null_rng;
 
18
      std::unique_ptr<Botan::Private_Key> key(Botan::PKCS8::load_key(input, null_rng));
 
19
      }
 
20
   catch(Botan::Exception& e) { }
 
21
   }