void-packages/srcpkgs/virtuoso/patches/patch-libsrc_Wi_xmlenc_algos_c.diff
2017-09-26 11:09:21 +00:00

134 lines
4.8 KiB
Diff

$OpenBSD: patch-libsrc_Wi_xmlenc_algos_c,v 1.1 2014/04/15 11:25:42 naddy Exp $
--- libsrc/Wi/xmlenc_algos.c.orig Fri Mar 23 13:28:31 2012
+++ libsrc/Wi/xmlenc_algos.c Tue Apr 15 00:27:50 2014
@@ -1162,10 +1162,10 @@ dsig_hmac_sha256_digest (dk_session_t * ses_in, long l
switch (key->xek_type)
{
case DSIG_KEY_3DES:
- memcpy (key_data, key->ki.triple_des.k1, sizeof (des_cblock));
- memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (des_cblock));
- memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (des_cblock));
- key_len = 3 * sizeof (des_cblock);
+ memcpy (key_data, key->ki.triple_des.k1, sizeof (DES_cblock));
+ memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (DES_cblock));
+ memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (DES_cblock));
+ key_len = 3 * sizeof (DES_cblock);
break;
#ifdef AES_ENC_ENABLE
case DSIG_KEY_AES:
@@ -1234,10 +1234,10 @@ dsig_hmac_sha256_verify (dk_session_t * ses_in, long l
switch (key->xek_type)
{
case DSIG_KEY_3DES:
- memcpy (key_data, key->ki.triple_des.k1, sizeof (des_cblock));
- memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (des_cblock));
- memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (des_cblock));
- key_len = 3 * sizeof (des_cblock);
+ memcpy (key_data, key->ki.triple_des.k1, sizeof (DES_cblock));
+ memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (DES_cblock));
+ memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (DES_cblock));
+ key_len = 3 * sizeof (DES_cblock);
break;
#ifdef AES_ENC_ENABLE
case DSIG_KEY_AES:
@@ -1599,10 +1599,10 @@ dsig_hmac_sha1_digest (dk_session_t * ses_in, long len
switch (key->xek_type)
{
case DSIG_KEY_3DES:
- memcpy (key_data, key->ki.triple_des.k1, sizeof (des_cblock));
- memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (des_cblock));
- memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (des_cblock));
- key_len = 3 * sizeof (des_cblock);
+ memcpy (key_data, key->ki.triple_des.k1, sizeof (DES_cblock));
+ memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (DES_cblock));
+ memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (DES_cblock));
+ key_len = 3 * sizeof (DES_cblock);
break;
#ifdef AES_ENC_ENABLE
case DSIG_KEY_AES:
@@ -1671,10 +1671,10 @@ dsig_hmac_sha1_verify (dk_session_t * ses_in, long len
switch (key->xek_type)
{
case DSIG_KEY_3DES:
- memcpy (key_data, key->ki.triple_des.k1, sizeof (des_cblock));
- memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (des_cblock));
- memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (des_cblock));
- key_len = 3 * sizeof (des_cblock);
+ memcpy (key_data, key->ki.triple_des.k1, sizeof (DES_cblock));
+ memcpy (key_data + 8, key->ki.triple_des.k2, sizeof (DES_cblock));
+ memcpy (key_data + 16, key->ki.triple_des.k3, sizeof (DES_cblock));
+ key_len = 3 * sizeof (DES_cblock);
break;
#ifdef AES_ENC_ENABLE
case DSIG_KEY_AES:
@@ -2240,13 +2240,13 @@ int xenc_des3_encryptor (dk_session_t * ses_in, long s
}
- des_ede3_cbc_encrypt ((const unsigned char *)buf,
+ DES_ede3_cbc_encrypt ((const unsigned char *)buf,
(unsigned char *)out_buf,
(long)DES_BLOCK_LEN,
- key->ki.triple_des.ks1,
- key->ki.triple_des.ks2,
- key->ki.triple_des.ks3,
- (des_cblock*) _iv,
+ &key->ki.triple_des.ks1,
+ &key->ki.triple_des.ks2,
+ &key->ki.triple_des.ks3,
+ (DES_cblock*) _iv,
DES_ENCRYPT);
total_blocks++;
@@ -2310,7 +2310,7 @@ int xenc_des3_decryptor (dk_session_t * ses_in_base64,
char *text, *text_beg;
dk_session_t *ses_in;
long text_len;
- des_cblock iv;
+ DES_cblock iv;
if (!seslen)
return 0;
@@ -2352,12 +2352,12 @@ int xenc_des3_decryptor (dk_session_t * ses_in_base64,
END_READ_FAIL (ses_in);
for (;!failed;)
{
- des_ede3_cbc_encrypt ((const unsigned char *)buf,
+ DES_ede3_cbc_encrypt ((const unsigned char *)buf,
(unsigned char *)out_buf,
(long)DES_BLOCK_LEN,
- key->ki.triple_des.ks1,
- key->ki.triple_des.ks2,
- key->ki.triple_des.ks3,
+ &key->ki.triple_des.ks1,
+ &key->ki.triple_des.ks2,
+ &key->ki.triple_des.ks3,
&iv,
DES_DECRYPT);
CATCH_READ_FAIL (ses_in)
@@ -2404,7 +2404,7 @@ int xenc_des3_decryptor (dk_session_t * ses_in_base64,
char out_buf[DES_BLOCK_LEN + 1];
char *text, *text_beg;
long text_len;
- des_cblock iv;
+ DES_cblock iv;
int blocks;
if (!seslen)
@@ -2440,12 +2440,12 @@ int xenc_des3_decryptor (dk_session_t * ses_in_base64,
memcpy (buf, text, DES_BLOCK_LEN);
text += DES_BLOCK_LEN;
- des_ede3_cbc_encrypt ((const unsigned char *)buf,
+ DES_ede3_cbc_encrypt ((const unsigned char *)buf,
(unsigned char *)out_buf,
(long)DES_BLOCK_LEN,
- key->ki.triple_des.ks1,
- key->ki.triple_des.ks2,
- key->ki.triple_des.ks3,
+ &key->ki.triple_des.ks1,
+ &key->ki.triple_des.ks2,
+ &key->ki.triple_des.ks3,
&iv,
DES_DECRYPT);