Test::Result test_response_certificate_access()
         {
         Test::Result result("OCSP response certificate access");

         try
            {
            Botan::OCSP::Response resp1(Test::read_binary_data_file("x509/ocsp/resp1.der"));
            const auto &certs1 = resp1.certificates();
            if(result.test_eq("Expected count of certificates", certs1.size(), 1))
               {
               const auto cert = certs1.front();
               const Botan::X509_DN expected_dn({std::make_pair(
                  "X520.CommonName",
                  "Symantec Class 3 EV SSL CA - G3 OCSP Responder")});
               const bool matches = cert.subject_dn() == expected_dn;
               result.test_eq("CN matches expected", matches, true);
               }

            Botan::OCSP::Response resp2(Test::read_binary_data_file("x509/ocsp/resp2.der"));
            const auto &certs2 = resp2.certificates();
            result.test_eq("Expect no certificates", certs2.size(), 0);
            }
         catch(Botan::Exception& e)
            {
            result.test_failure("Parsing failed", e.what());
            }

         return result;
         }
Esempio n. 2
0
void execLIST(session* ses, list<string> args) {
    openDataConnection(ses);
    if (ses->dsck <= 0) {
        cerr << "Data connection closed.\n";
    }

    string listing = runLs(ses, args);
    string resp("125 Data connection already open; transfer starting.");
    respond(ses, resp);

    // send listing through data connection
    write(ses->dsck, listing.c_str(), listing.length());

    string resp2("250 Requested file action okay, completed.");
    respond(ses, resp2);

    closeDataConnection(ses);
}
Double_t ex_respf1(Double_t *x, Double_t *par){
   return resp1(x,par)+resp2(x,par+1)+resp3(x,par+2)+resp4(x,par+3)+resp5(x,par+4)+expf1(x,par+5);
}