mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Tiny amount of infrastructure for having actual keys in PuTTYgen.
[originally from svn r2849]
This commit is contained in:
parent
0c1b343646
commit
c6a92bebfc
2
Recipe
2
Recipe
@ -161,4 +161,4 @@ PuTTYtel : [M] terminal wcwidth ldiscucs logging be_nossh mac macdlg macevlog
|
||||
+ stricmp vsnprint
|
||||
PuTTYgen : [M] macpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
|
||||
+ sshrand macnoise sshsha macstore misc sshrsa sshdss macmisc sshpubk
|
||||
+ sshaes sshsh512 import macpgen.rsrc
|
||||
+ sshaes sshsh512 import macpgen.rsrc macpgkey
|
||||
|
12
mac/mac.h
12
mac/mac.h
@ -43,7 +43,8 @@ extern struct mac_gestalts mac_gestalts;
|
||||
|
||||
/* Every window used by PuTTY has a refCon field pointing to one of these. */
|
||||
typedef struct {
|
||||
struct Session *s;
|
||||
struct Session *s; /* Only used in PuTTY */
|
||||
struct KeyState *ks; /* Only used in PuTTYgen */
|
||||
int wtype;
|
||||
} WinInfo;
|
||||
|
||||
@ -96,6 +97,13 @@ typedef struct Session {
|
||||
|
||||
extern Session *sesslist;
|
||||
|
||||
/* PuTTYgen per-window state */
|
||||
typedef struct KeyState {
|
||||
DialogPtr box;
|
||||
} KeyState;
|
||||
|
||||
#define mac_windowkey(w) (((WinInfo *)GetWRefCon(w))->ks)
|
||||
|
||||
/* from macdlg.c */
|
||||
extern void mac_newsession(void);
|
||||
extern void mac_dupsession(void);
|
||||
@ -164,6 +172,8 @@ extern Socket ot_register(void *, Plug);
|
||||
extern Socket ot_new(SockAddr addr, int, int, int, int, Plug);
|
||||
extern Socket ot_newlistener(char *, int, Plug, int);
|
||||
extern char *ot_addr_error(SockAddr);
|
||||
/* from macpgkey.c */
|
||||
extern void mac_newkey(void);
|
||||
/* Apple Event Handlers (in various files) */
|
||||
extern pascal OSErr mac_aevt_oapp(const AppleEvent *, AppleEvent *, long);
|
||||
extern pascal OSErr mac_aevt_odoc(const AppleEvent *, AppleEvent *, long);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: macpgen.c,v 1.1 2003/02/12 23:53:15 ben Exp $ */
|
||||
/* $Id: macpgen.c,v 1.2 2003/02/15 14:20:43 ben Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999, 2003 Ben Harris
|
||||
* All rights reserved.
|
||||
@ -126,7 +126,7 @@ static void mac_startup(void) {
|
||||
/* Get base system version (only used if there's no better selector) */
|
||||
if (Gestalt(gestaltSystemVersion, &mac_gestalts.sysvers) != noErr ||
|
||||
(mac_gestalts.sysvers &= 0xffff) < 0x700)
|
||||
fatalbox("PuTTY requires System 7 or newer");
|
||||
fatalbox("PuTTYgen requires System 7 or newer");
|
||||
/* Find out if we've got Color Quickdraw */
|
||||
if (Gestalt(gestaltQuickdrawVersion, &mac_gestalts.qdvers) != noErr)
|
||||
mac_gestalts.qdvers = gestaltOriginalQD;
|
||||
@ -457,6 +457,9 @@ static void mac_menucommand(long result) {
|
||||
break;
|
||||
case mFile:
|
||||
switch (item) {
|
||||
case iNew:
|
||||
mac_newkey();
|
||||
goto done;
|
||||
case iClose:
|
||||
mac_closewindow(window);
|
||||
goto done;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: macpgen.r,v 1.1 2003/02/12 23:53:15 ben Exp $ */
|
||||
/* $Id: macpgen.r,v 1.2 2003/02/15 14:20:43 ben Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999, 2002 Ben Harris
|
||||
* All rights reserved.
|
||||
@ -260,6 +260,11 @@ resource 'STR ' (-16397, purgeable) {
|
||||
"This file is used internally by PuTTY. It cannot be opened."
|
||||
};
|
||||
|
||||
/* Missing-application name string, for private keys. */
|
||||
/* XXX Private keys should eventually be owned by Pageant */
|
||||
resource 'STR ' (-16396, purgeable) {
|
||||
"PuTTYgen"
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal resources
|
||||
@ -435,3 +440,28 @@ resource 'TEXT' (wLicence, "licence", purgeable) {
|
||||
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE "
|
||||
"SOFTWARE."
|
||||
};
|
||||
|
||||
/* Key box */
|
||||
|
||||
resource 'DLOG' (wKey, "key", purgeable) {
|
||||
{ 0, 0, 120, 240 },
|
||||
noGrowDocProc,
|
||||
invisible,
|
||||
goAway,
|
||||
wAbout, /* RefCon -- identifies the window to PuTTY */
|
||||
wAbout, /* DITL ID */
|
||||
"untitled",
|
||||
staggerParentWindowScreen
|
||||
};
|
||||
|
||||
resource 'dlgx' (wKey, "key", purgeable) {
|
||||
versionZero {
|
||||
kDialogFlagsUseThemeBackground | kDialogFlagsUseThemeControls
|
||||
}
|
||||
};
|
||||
|
||||
resource 'DITL' (wKey, "key", purgeable) {
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: macpgrid.h,v 1.1 2003/02/12 23:53:15 ben Exp $ */
|
||||
/* $Id: macpgrid.h,v 1.2 2003/02/15 14:20:43 ben Exp $ */
|
||||
|
||||
/*
|
||||
* macpgrid.h -- Mac resource IDs for PuTTYgen
|
||||
@ -42,3 +42,4 @@
|
||||
#define wiAboutLicence 1
|
||||
#define wiAboutVersion 3
|
||||
#define wLicence 131
|
||||
#define wKey 134
|
||||
|
Loading…
Reference in New Issue
Block a user