summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/pdfencrypt.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-10-07 21:27:40 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-10-07 21:27:40 +0000
commitf2ecd8d86ead590b4799f8a54e96e11384df2b3b (patch)
treef09911f976da12bb0d87da0ec9edc2b489fa6087 /Build/source/texk/dvipdfm-x/pdfencrypt.c
parent7b61510c53b104577fa7804435895594da6bd884 (diff)
Fix a bug in inline PS code handling (S. Hirata)
git-svn-id: svn://tug.org/texlive/trunk@48853 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdfencrypt.c')
-rw-r--r--Build/source/texk/dvipdfm-x/pdfencrypt.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfencrypt.c b/Build/source/texk/dvipdfm-x/pdfencrypt.c
index 7a7f7bff63c..229d7d554ac 100644
--- a/Build/source/texk/dvipdfm-x/pdfencrypt.c
+++ b/Build/source/texk/dvipdfm-x/pdfencrypt.c
@@ -98,13 +98,13 @@ pdf_enc_compute_id_string (const char *producer,
MD5_init(&md5);
/* Don't use timezone for compatibility */
dpx_util_format_asn_date(datestr, 0);
- MD5_write(&md5, (unsigned char *)datestr, strlen(datestr));
+ MD5_write(&md5, (const unsigned char *)datestr, strlen(datestr));
if (producer)
- MD5_write(&md5, (unsigned char *)producer, strlen(producer));
+ MD5_write(&md5, (const unsigned char *)producer, strlen(producer));
if (dviname)
- MD5_write(&md5, (unsigned char *)dviname, strlen(dviname));
+ MD5_write(&md5, (const unsigned char *)dviname, strlen(dviname));
if (pdfname)
- MD5_write(&md5, (unsigned char *)pdfname, strlen(pdfname));
+ MD5_write(&md5, (const unsigned char *)pdfname, strlen(pdfname));
MD5_final(p->ID, &md5);
}
@@ -284,17 +284,20 @@ compute_hash_V5 (unsigned char *hash,
const unsigned char *salt,
const unsigned char *user_key, int R /* revision */)
{
- SHA256_CONTEXT sha;
unsigned char K[64];
size_t K_len;
int nround;
- SHA256_init (&sha);
- SHA256_write(&sha, (const unsigned char *)passwd, strlen(passwd));
- SHA256_write(&sha, salt, 8);
- if (user_key)
- SHA256_write(&sha, user_key, 48);
- SHA256_final(hash, &sha);
+ {
+ SHA256_CONTEXT sha;
+
+ SHA256_init (&sha);
+ SHA256_write(&sha, (const unsigned char *)passwd, strlen(passwd));
+ SHA256_write(&sha, salt, 8);
+ if (user_key)
+ SHA256_write(&sha, user_key, 48);
+ SHA256_final(hash, &sha);
+ }
ASSERT( R ==5 || R == 6 );