Addapt seldom compiled code to new semantics of the key schedule (not
[openssl.git] / crypto / des / des.c
index 2dcf1c2a24b48de2b373b667ca3274c4b13f4593..16e5ab9eb22da995f9517c4f20404417bc5a1241 100644 (file)
@@ -423,7 +423,7 @@ void doencryption(void)
                        else
                                k2[i-8]=k;
                        }
                        else
                                k2[i-8]=k;
                        }
-               des_set_key_unchecked(&k2,ks2);
+               des_set_key_unchecked(&k2,&ks2);
                memset(k2,0,sizeof(k2));
                }
        else if (longk || flag3)
                memset(k2,0,sizeof(k2));
                }
        else if (longk || flag3)
@@ -431,7 +431,7 @@ void doencryption(void)
                if (flag3)
                        {
                        des_string_to_2keys(key,&kk,&k2);
                if (flag3)
                        {
                        des_string_to_2keys(key,&kk,&k2);
-                       des_set_key_unchecked(&k2,ks2);
+                       des_set_key_unchecked(&k2,&ks2);
                        memset(k2,0,sizeof(k2));
                        }
                else
                        memset(k2,0,sizeof(k2));
                        }
                else
@@ -453,7 +453,7 @@ void doencryption(void)
                                kk[i]=key[i]|0x80;
                        }
 
                                kk[i]=key[i]|0x80;
                        }
 
-       des_set_key_unchecked(&kk,ks);
+       des_set_key_unchecked(&kk,&ks);
        memset(key,0,sizeof(key));
        memset(kk,0,sizeof(kk));
        /* woops - A bug that does not showup under unix :-( */
        memset(key,0,sizeof(key));
        memset(kk,0,sizeof(kk));
        /* woops - A bug that does not showup under unix :-( */
@@ -493,7 +493,7 @@ void doencryption(void)
                        if (cflag)
                                {
                                des_cbc_cksum(buf,&cksum,
                        if (cflag)
                                {
                                des_cbc_cksum(buf,&cksum,
-                                       (long)len,ks,&cksum);
+                                       (long)len,&ks,&cksum);
                                if (!eflag)
                                        {
                                        if (feof(DES_IN)) break;
                                if (!eflag)
                                        {
                                        if (feof(DES_IN)) break;
@@ -506,13 +506,13 @@ void doencryption(void)
                                        des_ecb_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
                                        des_ecb_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
-                                               ks,do_encrypt);
+                                               &ks,do_encrypt);
                        else if (flag3 && bflag)
                                for (i=0; i<l; i+=8)
                                        des_ecb2_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
                        else if (flag3 && bflag)
                                for (i=0; i<l; i+=8)
                                        des_ecb2_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
-                                               ks,ks2,do_encrypt);
+                                               &ks,&ks2,do_encrypt);
                        else if (flag3 && !bflag)
                                {
                                char tmpbuf[8];
                        else if (flag3 && !bflag)
                                {
                                char tmpbuf[8];
@@ -530,7 +530,7 @@ void doencryption(void)
                                {
                                des_cbc_encrypt(
                                        buf,obuf,
                                {
                                des_cbc_encrypt(
                                        buf,obuf,
-                                       (long)l,ks,&iv,do_encrypt);
+                                       (long)l,&ks,&iv,do_encrypt);
                                if (l >= 8) memcpy(iv,&(obuf[l-8]),8);
                                }
                        if (rem) memcpy(buf,&(buf[l]),(unsigned int)rem);
                                if (l >= 8) memcpy(iv,&(obuf[l-8]),8);
                                }
                        if (rem) memcpy(buf,&(buf[l]),(unsigned int)rem);
@@ -585,13 +585,13 @@ void doencryption(void)
                                        des_ecb_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
                                        des_ecb_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
-                                               ks,do_encrypt);
+                                               &ks,do_encrypt);
                        else if (flag3 && bflag)
                                for (i=0; i<l; i+=8)
                                        des_ecb2_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
                        else if (flag3 && bflag)
                                for (i=0; i<l; i+=8)
                                        des_ecb2_encrypt(
                                                (des_cblock *)&(buf[i]),
                                                (des_cblock *)&(obuf[i]),
-                                               ks,ks2,do_encrypt);
+                                               &ks,&ks2,do_encrypt);
                        else if (flag3 && !bflag)
                                {
                                des_3cbc_encrypt(
                        else if (flag3 && !bflag)
                                {
                                des_3cbc_encrypt(
@@ -603,7 +603,7 @@ void doencryption(void)
                                {
                                des_cbc_encrypt(
                                        buf,obuf,
                                {
                                des_cbc_encrypt(
                                        buf,obuf,
-                                       (long)l,ks,&iv,do_encrypt);
+                                       (long)l,&ks,&iv,do_encrypt);
                                if (l >= 8) memcpy(iv,&(buf[l-8]),8);
                                }
 
                                if (l >= 8) memcpy(iv,&(buf[l-8]),8);
                                }
 
@@ -629,7 +629,7 @@ void doencryption(void)
                                }
                        i=0;
                        if (cflag) des_cbc_cksum(obuf,
                                }
                        i=0;
                        if (cflag) des_cbc_cksum(obuf,
-                               (des_cblock *)cksum,(long)l/8*8,ks,
+                               (des_cblock *)cksum,(long)l/8*8,&ks,
                                (des_cblock *)cksum);
                        while (i != l)
                                {
                                (des_cblock *)cksum);
                        while (i != l)
                                {
@@ -665,8 +665,8 @@ void doencryption(void)
 problems:
        memset(buf,0,sizeof(buf));
        memset(obuf,0,sizeof(obuf));
 problems:
        memset(buf,0,sizeof(buf));
        memset(obuf,0,sizeof(obuf));
-       memset(ks,0,sizeof(ks));
-       memset(ks2,0,sizeof(ks2));
+       memset(&ks,0,sizeof(ks));
+       memset(&ks2,0,sizeof(ks2));
        memset(iv,0,sizeof(iv));
        memset(iv2,0,sizeof(iv2));
        memset(kk,0,sizeof(kk));
        memset(iv,0,sizeof(iv));
        memset(iv2,0,sizeof(iv2));
        memset(kk,0,sizeof(kk));