X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/clxutils/kcTool/kcTool.cpp?ds=inline diff --git a/SecurityTests/clxutils/kcTool/kcTool.cpp b/SecurityTests/clxutils/kcTool/kcTool.cpp deleted file mode 100644 index a52730f7..00000000 --- a/SecurityTests/clxutils/kcTool/kcTool.cpp +++ /dev/null @@ -1,297 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define KC_DB_PATH "Library/Keychains" /* relative to home */ - -static void usage(char **argv) -{ - printf("usage: %s keychainName command [options]\n", argv[0]); - printf("Commands:\n"); - printf(" c create\n"); - printf(" s get status\n"); - printf(" l lock\n"); - printf(" u unlock\n"); - printf(" a add genericPassword\n"); - printf(" g get (lookup) genericPassword\n"); - printf(" d delete genericPassword\n"); - printf("Options:\n"); - printf(" p=keychainPassword\n"); - printf(" g=genericPassword\n"); - printf("Options (for create only):\n"); - printf(" l=lockIntervalInSeconds\n"); - printf(" L (no lockOnSleep)\n"); - printf(" n(o user prompt)\n"); - printf(" h(elp)\n"); - exit(1); -} - -/* - * For add/search generic password - */ -#define GP_SERVICE_NAME "kctool" -#define GP_SERVICE_NAME_LEN ((UInt32)strlen(GP_SERVICE_NAME)) -#define GP_ACCOUNT_NAME "John Galt" -#define GP_ACCOUNT_NAME_LEN ((UInt32)strlen(GP_ACCOUNT_NAME)) - -typedef enum { - KC_Nop, - KC_CreateKC, - KC_GetStatus, - KC_LockKC, - KC_UnlockKC, - KC_AddPasswd, - KC_LookupPasswd, - KC_DeletePasswd -} KcOp; - -static void showError( - OSStatus ortn, - const char *msg) -{ - printf("***Error %d on %s.\n", (int)ortn, msg); -} - -static void safePrint( - char *buf, - UInt32 len) -{ - UInt32 i; - char c; - - for(i=0; i