Skip to content

Commit

Permalink
Pageant: move extension list out into header file.
Browse files Browse the repository at this point in the history
That's a part of the protocol spec (ish), so it should be somewhere
reasonably sensible rather than buried in the middle of a source file.
  • Loading branch information
sgtatham committed Dec 15, 2020
1 parent 78e006b commit 3687df7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pageant.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,6 @@ static bool reencrypt_key(PageantKey *pk)
return true;
}

#define PUTTYEXT(base) base "@putty.projects.tartarus.org"

#define KNOWN_EXTENSIONS(X) \
X(EXT_QUERY, "query") \
X(EXT_ADD_PPK, PUTTYEXT("add-ppk")) \
X(EXT_REENCRYPT, PUTTYEXT("reencrypt")) \
X(EXT_REENCRYPT_ALL, PUTTYEXT("reencrypt-all")) \
/* end of list */

#define DECL_EXT_ENUM(id, name) id,
enum Extension { KNOWN_EXTENSIONS(DECL_EXT_ENUM) EXT_UNKNOWN };
#define DEF_EXT_NAMES(id, name) PTRLEN_DECL_LITERAL(name),
Expand Down
12 changes: 12 additions & 0 deletions pageant.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,15 @@ int pageant_reencrypt_key(struct pageant_pubkey *key, char **retstr);
int pageant_reencrypt_all_keys(char **retstr);
int pageant_sign(struct pageant_pubkey *key, ptrlen message, strbuf *out,
uint32_t flags, char **retstr);

/*
* Definitions for agent protocol extensions.
*/
#define PUTTYEXT(base) base "@putty.projects.tartarus.org"

#define KNOWN_EXTENSIONS(X) \
X(EXT_QUERY, "query") \
X(EXT_ADD_PPK, PUTTYEXT("add-ppk")) \
X(EXT_REENCRYPT, PUTTYEXT("reencrypt")) \
X(EXT_REENCRYPT_ALL, PUTTYEXT("reencrypt-all")) \
/* end of list */

0 comments on commit 3687df7

Please sign in to comment.