summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-06 21:40:51 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-06 21:40:51 +0000
commit7d9c38f37ae608265c3f7fa2f87795419afe6069 (patch)
tree621c8078e155f13b2251f7bc0df2b36333314128 /cipher.c
parent3dca4f55f20cb62c8cfc5d050027a49bf3590b55 (diff)
- markus@cvs.openbsd.org 2002/06/04 23:05:49
[cipher.c monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c] __FUNCTION__ -> __func__ NOTE: This includes all portable references also.
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/cipher.c b/cipher.c
index db5a7228a..39807d5c2 100644
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: cipher.c,v 1.57 2002/05/30 08:07:31 markus Exp $"); 38RCSID("$OpenBSD: cipher.c,v 1.58 2002/06/04 23:05:49 markus Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "log.h" 41#include "log.h"
@@ -595,7 +595,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
595 if (evplen == 0) 595 if (evplen == 0)
596 return; 596 return;
597 if (evplen != len) 597 if (evplen != len)
598 fatal("%s: wrong iv length %d != %d", __FUNCTION__, 598 fatal("%s: wrong iv length %d != %d", __func__,
599 evplen, len); 599 evplen, len);
600 600
601#if OPENSSL_VERSION_NUMBER < 0x00907000L 601#if OPENSSL_VERSION_NUMBER < 0x00907000L
@@ -604,7 +604,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
604 604
605 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 605 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
606 if (aesc == NULL) 606 if (aesc == NULL)
607 fatal("%s: no rijndael context", __FUNCTION__); 607 fatal("%s: no rijndael context", __func__);
608 civ = aesc->r_iv; 608 civ = aesc->r_iv;
609 } else 609 } else
610#endif 610#endif
@@ -615,18 +615,18 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
615 case SSH_CIPHER_3DES: { 615 case SSH_CIPHER_3DES: {
616 struct ssh1_3des_ctx *desc; 616 struct ssh1_3des_ctx *desc;
617 if (len != 24) 617 if (len != 24)
618 fatal("%s: bad 3des iv length: %d", __FUNCTION__, len); 618 fatal("%s: bad 3des iv length: %d", __func__, len);
619 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 619 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
620 if (desc == NULL) 620 if (desc == NULL)
621 fatal("%s: no 3des context", __FUNCTION__); 621 fatal("%s: no 3des context", __func__);
622 debug3("%s: Copying 3DES IV", __FUNCTION__); 622 debug3("%s: Copying 3DES IV", __func__);
623 memcpy(iv, desc->k1.iv, 8); 623 memcpy(iv, desc->k1.iv, 8);
624 memcpy(iv + 8, desc->k2.iv, 8); 624 memcpy(iv + 8, desc->k2.iv, 8);
625 memcpy(iv + 16, desc->k3.iv, 8); 625 memcpy(iv + 16, desc->k3.iv, 8);
626 return; 626 return;
627 } 627 }
628 default: 628 default:
629 fatal("%s: bad cipher %d", __FUNCTION__, c->number); 629 fatal("%s: bad cipher %d", __func__, c->number);
630 } 630 }
631 memcpy(iv, civ, len); 631 memcpy(iv, civ, len);
632} 632}
@@ -652,7 +652,7 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
652 652
653 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 653 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
654 if (aesc == NULL) 654 if (aesc == NULL)
655 fatal("%s: no rijndael context", __FUNCTION__); 655 fatal("%s: no rijndael context", __func__);
656 div = aesc->r_iv; 656 div = aesc->r_iv;
657 } else 657 } else
658#endif 658#endif
@@ -664,15 +664,15 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
664 struct ssh1_3des_ctx *desc; 664 struct ssh1_3des_ctx *desc;
665 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 665 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
666 if (desc == NULL) 666 if (desc == NULL)
667 fatal("%s: no 3des context", __FUNCTION__); 667 fatal("%s: no 3des context", __func__);
668 debug3("%s: Installed 3DES IV", __FUNCTION__); 668 debug3("%s: Installed 3DES IV", __func__);
669 memcpy(desc->k1.iv, iv, 8); 669 memcpy(desc->k1.iv, iv, 8);
670 memcpy(desc->k2.iv, iv + 8, 8); 670 memcpy(desc->k2.iv, iv + 8, 8);
671 memcpy(desc->k3.iv, iv + 16, 8); 671 memcpy(desc->k3.iv, iv + 16, 8);
672 return; 672 return;
673 } 673 }
674 default: 674 default:
675 fatal("%s: bad cipher %d", __FUNCTION__, c->number); 675 fatal("%s: bad cipher %d", __func__, c->number);
676 } 676 }
677 memcpy(div, iv, evplen); 677 memcpy(div, iv, evplen);
678} 678}
@@ -695,7 +695,7 @@ cipher_get_keycontext(CipherContext *cc, u_char *dat)
695 struct ssh1_3des_ctx *desc; 695 struct ssh1_3des_ctx *desc;
696 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 696 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
697 if (desc == NULL) 697 if (desc == NULL)
698 fatal("%s: no 3des context", __FUNCTION__); 698 fatal("%s: no 3des context", __func__);
699 plen = EVP_X_STATE_LEN(desc->k1); 699 plen = EVP_X_STATE_LEN(desc->k1);
700 if (dat == NULL) 700 if (dat == NULL)
701 return (3*plen); 701 return (3*plen);
@@ -724,7 +724,7 @@ cipher_set_keycontext(CipherContext *cc, u_char *dat)
724 struct ssh1_3des_ctx *desc; 724 struct ssh1_3des_ctx *desc;
725 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp); 725 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
726 if (desc == NULL) 726 if (desc == NULL)
727 fatal("%s: no 3des context", __FUNCTION__); 727 fatal("%s: no 3des context", __func__);
728 plen = EVP_X_STATE_LEN(desc->k1); 728 plen = EVP_X_STATE_LEN(desc->k1);
729 memcpy(EVP_X_STATE(desc->k1), dat, plen); 729 memcpy(EVP_X_STATE(desc->k1), dat, plen);
730 memcpy(EVP_X_STATE(desc->k2), dat + plen, plen); 730 memcpy(EVP_X_STATE(desc->k2), dat + plen, plen);