summaryrefslogtreecommitdiff
path: root/apps/windows
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-08-19 02:39:58 +0200
committerTor Andersson <tor@ghostscript.com>2009-08-19 02:39:58 +0200
commitac4f72884effe8c177f09d27bf4977c84eb3ec58 (patch)
tree5f0eafafab91d1dc07434f0a23b19399c6682818 /apps/windows
parent1d2eb9d542b11e488dbd206c6ef9936b4f60fc13 (diff)
downloadmupdf-ac4f72884effe8c177f09d27bf4977c84eb3ec58.tar.xz
Implement support for AES encryption.
Diffstat (limited to 'apps/windows')
-rw-r--r--apps/windows/winmain.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c
index 657be9d4..f278b199 100644
--- a/apps/windows/winmain.c
+++ b/apps/windows/winmain.c
@@ -21,7 +21,7 @@ static LRESULT CALLBACK frameproc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK viewproc(HWND, UINT, WPARAM, LPARAM);
static int bmpstride = 0;
-static char *bmpdata = NULL;
+static unsigned char *bmpdata = NULL;
static int justcopied = 0;
static pdfapp_t gapp;
@@ -199,12 +199,13 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
SetDlgItemTextA(hwnd, 0x10, gapp.filename);
- sprintf(buf, "PDF %g", xref->version);
+ sprintf(buf, "PDF %d.%d", xref->version / 10, xref->version % 10);
SetDlgItemTextA(hwnd, 0x11, buf);
if (xref->crypt)
{
- sprintf(buf, "Standard %d bit RC4", xref->crypt->len * 8);
+ sprintf(buf, "Standard %d bit %s", xref->crypt->length,
+ xref->crypt->strf.method == PDF_CRYPT_AESV2 ? "AES" : "RC4");
SetDlgItemTextA(hwnd, 0x12, buf);
strcpy(buf, "");
if (xref->crypt->p & (1 << 2))
@@ -423,8 +424,8 @@ void winconvert(pdfapp_t *app, fz_pixmap *image)
for (y = 0; y < image->h; y++)
{
- char *p = bmpdata + y * bmpstride;
- char *s = image->samples + y * image->w * 4;
+ unsigned char *p = bmpdata + y * bmpstride;
+ unsigned char *s = image->samples + y * image->w * 4;
for (x = 0; x < image->w; x++)
{
p[x * 3 + 0] = s[x * 4 + 3];