From 490d36e65ac24e34e3021c2a0947384aee138c88 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 13 Apr 2016 21:05:14 -0400 Subject: Root commit for new Compass repository This is the Alpha version of ComPASS, originally developed sometime in 2014. --- Compass.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Compass.h (limited to 'Compass.h') diff --git a/Compass.h b/Compass.h new file mode 100644 index 0000000..1cb9dcd --- /dev/null +++ b/Compass.h @@ -0,0 +1,70 @@ +#ifndef COMPASS_H +#define COMPASS_H + +#include +#include + +#ifdef WIN32 +#include +#else +#include +#include +#endif // WIN32 + +#include "Options.h" +#include "Keychain.h" +#include "Cryptor.h" +#include "Help.h" + +#define ALLOW_WALK 0 +#define SECONDS_PSWD_CLEANUP 30 +#define CLEAN_STRING "compass-cleared" + +#define WARN_CANT_CLEANUP "Warning: automatic clipboard cleanup failed to start." +#define WARN_WONT_CLEANUP "Warning: automatic clipboard cleanup squelched" + +#define ERR_NO_ACTION "Error: no action specified." +#define ERR_RH_NOT_ALLOWED "Error: this action does not support the remote-host option." +#define ERR_REQ_PARAMS_MISSING "Error: required parameters are missing." +#define ERR_INVALID_ACTION "Error: action not recognized." +#define ERR_CLIPBOARD "Error placing password in clipboard. Try using the -pp option." +#define ERR_INPUT "Error: formatting problem with input text." +#define ERR_GENERIC "There was a problem reading/writing the keychain. You may have typed your master password incorrectly, the file may be currupt or missing, you may not have permissions in this directory, or a network error may have occoured." + +#define MSG_CLIPBOARD "Password was placed in clipboard." + +class Compass { +public: + Compass(); + virtual ~Compass(); + + void perform(int argc, char* argv[]); + +private: + Options opt; + + void initNoArgs(int argc, char* argv[]); + std::string initOneArg(int argc, char* argv[]); + + void showResult(Credential c); + void pasteClipboard(std::string text, bool clean, bool recur); + + // Help + void help(); + + // Actions + void initialize(); + void create(std::string service); + void walk(); + void rekey(); + void get(std::string service); + void _delete(std::string service); + void show(std::string service, bool like); + void random(); + void markReset(std::string service); + void checkReset(std::string service); + void ruser(std::string service); + void rpass(std::string service); +}; + +#endif // COMPASS_H -- cgit v1.2.3