Esempio n. 1
0
    int do_main(int argc, char ** argv,
            get_hmac_key_prototype * hmac_fn,
            get_trace_key_prototype * trace_fn)
    {
        Inifile ini;
        { ConfigurationLoader cfg_loader_full(ini.configuration_holder(), CFG_PATH "/" RDPPROXY_INI); }

        UdevRandom rnd;
        CryptoContext cctx(rnd, ini);
        cctx.set_get_hmac_key_cb(hmac_fn);
        cctx.set_get_trace_key_cb(trace_fn);

        int res = -1;
        try {
            res = app_decrypter(
                argc, argv
              , "ReDemPtion DECrypter " VERSION ".\n"
                "Copyright (C) Wallix 2010-2015.\n"
                "Christophe Grosjean, Raphael Zhou."
              , cctx);
            if (res == 0){
                printf("decrypt ok");
            }
            else {
                printf("decrypt failed\n");
            }
        } catch (const Error & e) {
            printf("decrypt failed: with id=%d\n", e.id);
        }
        return res;
    }
Esempio n. 2
0
    int do_main(int argc, char** argv,
            get_hmac_key_prototype * hmac_fn,
            get_trace_key_prototype * trace_fn)
    {
        std::string config_filename = CFG_PATH "/" RDPPROXY_INI;
        Inifile ini;

        UdevRandom rnd;
        CryptoContext cctx(rnd, ini);
        cctx.set_get_hmac_key_cb(hmac_fn);
        cctx.set_get_trace_key_cb(trace_fn);

        int res = -1;
        try {
            res = app_recorder<Capture>(
                argc, argv
              , "ReDemPtion RECorder " VERSION ": An RDP movie converter.\n"
                "Copyright (C) Wallix 2010-2015.\n"
                "Christophe Grosjean, Jonathan Poelen and Raphael Zhou."
              , [](po::options_description const &){}
              , [](Inifile const & ini, po::variables_map const &, std::string const & output_filename) -> int {
                    if (   output_filename.length()
                        && !(
                            bool(ini.get<cfg::video::capture_flags>()
                                & (CaptureFlags::png | CaptureFlags::wrm)
                            ) | ini.get<cfg::globals::capture_chunk>()
                        )
                    ) {
                        std::cerr << "Missing target format : need --png or --wrm\n" << std::endl;
                        return -1;
                    }
                    return 0;
              }
              // TODO: now that we have cctx the lambda is useless
              , config_filename, ini, cctx, rnd
              , [](Inifile const &) { return false; }/*has_extra_capture*/
              , false // full_video
            );
        } catch (const Error & e) {
            printf("decrypt failed: with id=%d\n", e.id);
        }
        return res;
    }