| 478 |
return (ret); // success |
return (ret); // success |
| 479 |
} |
} |
| 480 |
|
|
| 481 |
static char FAR *copy_mp_int(char FAR * num) |
static char *copy_mp_int(char *num) |
| 482 |
{ |
{ |
| 483 |
int len = (get_ushort16_MSBfirst(num) + 7) / 8 + 2; |
int len = (get_ushort16_MSBfirst(num) + 7) / 8 + 2; |
| 484 |
char FAR *result = (char FAR *) malloc(len); |
char *result = (char *) malloc(len); |
| 485 |
|
|
| 486 |
if (result != NULL) { |
if (result != NULL) { |
| 487 |
memcpy(result, num, len); |
memcpy(result, num, len); |
| 2081 |
strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
| 2082 |
} |
} |
| 2083 |
} |
} |
| 2084 |
SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char FAR *)buf); |
SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf); |
| 2085 |
free(buf); |
free(buf); |
| 2086 |
} |
} |
| 2087 |
|
|
| 2088 |
if (ctx->nold > 0) { |
if (ctx->nold > 0) { |
| 2089 |
buf_len = 100 * ctx->nold; |
buf_len = 100 * ctx->nold; |
| 2090 |
buf = calloc(100, ctx->nold); |
buf = calloc(100, ctx->nold); |
| 2091 |
SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char FAR *)""); |
SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)""); |
| 2092 |
for (i = 0; i < ctx->nold; i++) { |
for (i = 0; i < ctx->nold; i++) { |
| 2093 |
switch (dgst_alg) { |
switch (dgst_alg) { |
| 2094 |
case SSH_DIGEST_MD5: |
case SSH_DIGEST_MD5: |
| 2109 |
strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
strncat_s(buf, buf_len, "\r\n", _TRUNCATE); |
| 2110 |
} |
} |
| 2111 |
} |
} |
| 2112 |
SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char FAR *)buf); |
SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf); |
| 2113 |
free(buf); |
free(buf); |
| 2114 |
} |
} |
| 2115 |
} |
} |