* We need this to link with the RSA code, because rsaencrypt()
* pads its data with random bytes. Since we only use rsadecrypt()
* and the signing functions, which are deterministic, this should
* We need this to link with the RSA code, because rsaencrypt()
* pads its data with random bytes. Since we only use rsadecrypt()
* and the signing functions, which are deterministic, this should
*/
static int CALLBACK PassphraseProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
*/
static int CALLBACK PassphraseProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
GetDlgItemText (hwnd, 102, passphrase, PASSPHRASE_MAXLEN-1);
passphrase[PASSPHRASE_MAXLEN-1] = '\0';
}
GetDlgItemText (hwnd, 102, passphrase, PASSPHRASE_MAXLEN-1);
passphrase[PASSPHRASE_MAXLEN-1] = '\0';
}
if (keylist) {
SendDlgItemMessage(keylist, 100, LB_RESETCONTENT, 0, 0);
if (keylist) {
SendDlgItemMessage(keylist, 100, LB_RESETCONTENT, 0, 0);
SendDlgItemMessage (keylist, 100, LB_ADDSTRING,
0, (LPARAM)listentry);
}
SendDlgItemMessage (keylist, 100, LB_ADDSTRING,
0, (LPARAM)listentry);
}
if (ver == 1)
needs_pass = rsakey_encrypted(filename, &comment);
else
needs_pass = ssh2_userkey_encrypted(filename, &comment);
if (ver == 1)
needs_pass = rsakey_encrypted(filename, &comment);
else
needs_pass = ssh2_userkey_encrypted(filename, &comment);
if (ret == 0) {
MessageBox(NULL, "Couldn't load private key.", APPNAME,
MB_OK | MB_ICONERROR);
if (ret == 0) {
MessageBox(NULL, "Couldn't load private key.", APPNAME,
MB_OK | MB_ICONERROR);
if (ver == 1) {
if (already_running) {
unsigned char *request, *response;
int reqlen, clen, resplen;
if (ver == 1) {
if (already_running) {
unsigned char *request, *response;
int reqlen, clen, resplen;
agent_query(request, reqlen, &response, &resplen);
agent_query(request, reqlen, &response, &resplen);
if (resplen < 5 || response[4] != SSH_AGENT_SUCCESS)
MessageBox(NULL, "The already running Pageant "
"refused to add the key.", APPNAME,
if (resplen < 5 || response[4] != SSH_AGENT_SUCCESS)
MessageBox(NULL, "The already running Pageant "
"refused to add the key.", APPNAME,
if (already_running) {
unsigned char *request, *response;
int reqlen, alglen, clen, keybloblen, resplen;
if (already_running) {
unsigned char *request, *response;
int reqlen, alglen, clen, keybloblen, resplen;
reqlen = 4 + 1 + /* length, message type */
4 + alglen + /* algorithm name */
keybloblen + /* key data */
4 + clen /* comment */
;
reqlen = 4 + 1 + /* length, message type */
4 + alglen + /* algorithm name */
keybloblen + /* key data */
4 + clen /* comment */
;
reqlen += skey->alg->openssh_fmtkey(skey->data,
request+reqlen, keybloblen);
reqlen += skey->alg->openssh_fmtkey(skey->data,
request+reqlen, keybloblen);
reqlen += clen+4;
agent_query(request, reqlen, &response, &resplen);
reqlen += clen+4;
agent_query(request, reqlen, &response, &resplen);
if (resplen < 5 || response[4] != SSH_AGENT_SUCCESS)
MessageBox(NULL, "The already running Pageant"
"refused to add the key.", APPNAME,
MB_OK | MB_ICONERROR);
if (resplen < 5 || response[4] != SSH_AGENT_SUCCESS)
MessageBox(NULL, "The already running Pageant"
"refused to add the key.", APPNAME,
MB_OK | MB_ICONERROR);
} else {
if (add234(ssh2keys, skey) != skey) {
skey->alg->freekey(skey->data);
} else {
if (add234(ssh2keys, skey) != skey) {
skey->alg->freekey(skey->data);
PUT_32BIT(p, bignum_bitcount(key->modulus));
p += 4;
p += ssh1_write_bignum(p, key->exponent);
PUT_32BIT(p, bignum_bitcount(key->modulus));
p += 4;
p += ssh1_write_bignum(p, key->exponent);
nkeys++;
len += 4; /* length field */
blob = key->alg->public_blob(key->data, &bloblen);
nkeys++;
len += 4; /* length field */
blob = key->alg->public_blob(key->data, &bloblen);
*/
static int CALLBACK KeyListProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
*/
static int CALLBACK KeyListProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
int n = SendDlgItemMessage (hwnd, 100, LB_GETCURSEL, 0, 0);
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
int n = SendDlgItemMessage (hwnd, 100, LB_GETCURSEL, 0, 0);