diff options
author | Jack Lloyd <[email protected]> | 2017-12-04 15:57:31 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-04 15:57:31 -0500 |
commit | 5022191613a44f6d603294abfa79b2faf5a175ed (patch) | |
tree | fa237089991bd80bdef354c6c2bd639f69da5ac1 /src | |
parent | 697fdc8fcb7f4ada4699ccad80def4673270d133 (diff) |
Need binary IO for Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/x509/pkcs10.cpp | 2 | ||||
-rw-r--r-- | src/lib/x509/x509_crl.cpp | 2 | ||||
-rw-r--r-- | src/lib/x509/x509_obj.cpp | 12 | ||||
-rw-r--r-- | src/lib/x509/x509cert.cpp | 2 | ||||
-rw-r--r-- | src/tests/unit_x509.cpp | 2 |
5 files changed, 5 insertions, 15 deletions
diff --git a/src/lib/x509/pkcs10.cpp b/src/lib/x509/pkcs10.cpp index a17ffeb0f..1f7e915ff 100644 --- a/src/lib/x509/pkcs10.cpp +++ b/src/lib/x509/pkcs10.cpp @@ -47,7 +47,7 @@ PKCS10_Request::PKCS10_Request(const std::vector<uint8_t>& vec) #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) PKCS10_Request::PKCS10_Request(const std::string& fsname) { - DataSource_Stream src(fsname); + DataSource_Stream src(fsname, true); load_data(src); } #endif diff --git a/src/lib/x509/x509_crl.cpp b/src/lib/x509/x509_crl.cpp index 4fa5df44f..a739d2f60 100644 --- a/src/lib/x509/x509_crl.cpp +++ b/src/lib/x509/x509_crl.cpp @@ -49,7 +49,7 @@ X509_CRL::X509_CRL(const std::vector<uint8_t>& vec) #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) X509_CRL::X509_CRL(const std::string& fsname) { - DataSource_Stream src(fsname); + DataSource_Stream src(fsname, true); load_data(src); } #endif diff --git a/src/lib/x509/x509_obj.cpp b/src/lib/x509/x509_obj.cpp index 019bac0b1..4450df7bb 100644 --- a/src/lib/x509/x509_obj.cpp +++ b/src/lib/x509/x509_obj.cpp @@ -113,17 +113,7 @@ void X509_Object::decode_from(BER_Decoder& from) .decode(m_sig, BIT_STRING) .end_cons(); - try { - force_decode(); - } - catch(Decoding_Error& e) - { - throw Decoding_Error(PEM_label() + " decoding failed", e.what()); - } - catch(Invalid_Argument& e) - { - throw Decoding_Error(PEM_label() + " decoding failed", e.what()); - } + force_decode(); } /* diff --git a/src/lib/x509/x509cert.cpp b/src/lib/x509/x509cert.cpp index 35dbd4c38..acd6b3362 100644 --- a/src/lib/x509/x509cert.cpp +++ b/src/lib/x509/x509cert.cpp @@ -84,7 +84,7 @@ X509_Certificate::X509_Certificate(const std::vector<uint8_t>& vec) #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) X509_Certificate::X509_Certificate(const std::string& fsname) { - DataSource_Stream src(fsname); + DataSource_Stream src(fsname, true); load_data(src); } #endif diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp index 5fbea2f4f..da5439a05 100644 --- a/src/tests/unit_x509.cpp +++ b/src/tests/unit_x509.cpp @@ -776,7 +776,7 @@ Test::Result test_x509_decode_list() { Test::Result result("X509_Certificate list decode"); - Botan::DataSource_Stream input(Test::data_file("x509/misc/cert_seq.der")); + Botan::DataSource_Stream input(Test::data_file("x509/misc/cert_seq.der"), true); Botan::BER_Decoder dec(input); std::vector<Botan::X509_Certificate> certs; |