Skip to content

Commit

Permalink
replace to DEBUG_{CRYPT,NET} from DEBUG_{DCRYPT,DNET}.
Browse files Browse the repository at this point in the history
  • Loading branch information
sakane committed Jun 27, 2000
1 parent 55b7b39 commit 64eb666
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
4 changes: 1 addition & 3 deletions kame/kame/racoon/debug.h
Expand Up @@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* YIPS @(#)$Id: debug.h,v 1.10 2000/05/24 09:58:54 itojun Exp $ */
/* YIPS @(#)$Id: debug.h,v 1.11 2000/06/27 16:56:34 sakane Exp $ */

#define DEBUG_INFO 0x00000002 /* force informational */
#define DEBUG_NOTIFY 0x00000004 /* force notify */
Expand All @@ -52,9 +52,7 @@
#define DEBUG_MISC 0x00000200 /*XX*/

#define DEBUG_DSA (DEBUG_SVERB | DEBUG_SA)
#define DEBUG_DCRYPT (DEBUG_SVERB | DEBUG_CRYPT)
#define DEBUG_DKEY (DEBUG_SVERB | DEBUG_KEY)
#define DEBUG_DNET (DEBUG_SVERB | DEBUG_NET)
#define DEBUG_DPFKEY (DEBUG_SVERB | DEBUG_PFKEY)
#define DEBUG_DCERT (DEBUG_SVERB | DEBUG_CERT) /* private key */
#define DEBUG_DMISC (DEBUG_SVERB | DEBUG_MISC)
Expand Down
10 changes: 5 additions & 5 deletions kame/kame/racoon/isakmp.c
Expand Up @@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* YIPS @(#)$Id: isakmp.c,v 1.75 2000/06/14 18:54:32 sakane Exp $ */
/* YIPS @(#)$Id: isakmp.c,v 1.76 2000/06/27 16:56:34 sakane Exp $ */

#include <sys/types.h>
#include <sys/param.h>
Expand Down Expand Up @@ -203,11 +203,11 @@ isakmp_handler(so_isakmp)
}

YIPSDEBUG(DEBUG_USEFUL, plog(logp, LOCATION, NULL, "===\n"));
YIPSDEBUG(DEBUG_NET,
YIPSDEBUG(DEBUG_NOTIFY,
plog(logp, LOCATION, (struct sockaddr *)&local,
"%d bytes message received from %s\n",
len, saddr2str((struct sockaddr *)&remote)));
YIPSDEBUG(DEBUG_DNET, PVDUMP(buf));
YIPSDEBUG(DEBUG_NET, PVDUMP(buf));

/* avoid packets with malicious port/address */
switch (remote.ss_family) {
Expand Down Expand Up @@ -1259,11 +1259,11 @@ isakmp_send(iph1, buf)
}
}

YIPSDEBUG(DEBUG_NET,
YIPSDEBUG(DEBUG_NOTIFY,
plog(logp, LOCATION, iph1->local,
"%d times of %d bytes message will be sent.\n",
iph1->rmconf->count_persend, len));
YIPSDEBUG(DEBUG_DNET, PVDUMP(buf));
YIPSDEBUG(DEBUG_NET, PVDUMP(buf));

return 0;
}
Expand Down
34 changes: 17 additions & 17 deletions kame/kame/racoon/oakley.c
Expand Up @@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* YIPS @(#)$Id: oakley.c,v 1.39 2000/06/19 09:21:25 sakane Exp $ */
/* YIPS @(#)$Id: oakley.c,v 1.40 2000/06/27 16:56:34 sakane Exp $ */

#include <sys/types.h>
#include <sys/param.h>
Expand Down Expand Up @@ -1831,8 +1831,8 @@ oakley_compute_enckey(iph1)
plog(logp, LOCATION, NULL,
"compute intermediate cipher key K%d\n",
subkey));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(buf));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(res));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(buf));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(res));

cplen = (res->l < ep - p) ? res->l : ep - p;
memcpy(p, res->v, cplen);
Expand Down Expand Up @@ -1867,7 +1867,7 @@ oakley_compute_enckey(iph1)

YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL, "final cipher key computed: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(iph1->key));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(iph1->key));

error = 0;

Expand Down Expand Up @@ -1941,7 +1941,7 @@ oakley_newiv(iph1)
vfree(buf);

YIPSDEBUG(DEBUG_CRYPT, plog(logp, LOCATION, NULL, "IV computed: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(newivm->iv));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(newivm->iv));

iph1->ivm = newivm;

Expand Down Expand Up @@ -1987,7 +1987,7 @@ oakley_newiv2(iph1, msgid)
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL, "compute IV for phase2\n"));
YIPSDEBUG(DEBUG_CRYPT, plog(logp, LOCATION, NULL, "phase1 last IV: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(buf));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(buf));

/* allocate IVm */
newivm = CALLOC(sizeof(struct isakmp_ivm), struct isakmp_ivm *);
Expand All @@ -2012,7 +2012,7 @@ oakley_newiv2(iph1, msgid)

YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL, "phase2 IV computed: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(newivm->iv));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(newivm->iv));

end:
if (error && newivm != NULL)
Expand Down Expand Up @@ -2064,7 +2064,7 @@ oakley_do_decrypt(iph1, msg, ivdp, ivep)
memcpy(ivep->v, (caddr_t)&msg->v[msg->l - CBC_BLOCKLEN], CBC_BLOCKLEN);

YIPSDEBUG(DEBUG_CRYPT, plog(logp, LOCATION, NULL, "IV saved: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(ivep));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(ivep));
YIPSDEBUG(DEBUG_CRYPT, plog(logp, LOCATION, NULL, "IV not sync yet\n"));

pl = msg->v + sizeof(struct isakmp);
Expand Down Expand Up @@ -2092,7 +2092,7 @@ oakley_do_decrypt(iph1, msg, ivdp, ivep)
plog(logp, LOCATION, NULL,
"decrypt(%s)\n",
cipher[iph1->approval->enctype].name));
YIPSDEBUG(DEBUG_DCRYPT,
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"with key: ");
PVDUMP(iph1->key));
Expand All @@ -2103,15 +2103,15 @@ oakley_do_decrypt(iph1, msg, ivdp, ivep)
if (new == NULL)
goto end;

YIPSDEBUG(DEBUG_DCRYPT,
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"decrypted payload by IV: ");
PVDUMP(ivdp));

YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"decrypted payload, but not trimed.\n"));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(new));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(new));

/* get padding length */
if (lcconf->pad_excltail)
Expand All @@ -2128,7 +2128,7 @@ oakley_do_decrypt(iph1, msg, ivdp, ivep)
plog(logp, LOCATION, NULL,
"invalied padding len=%u, buflen=%u.\n",
padlen, new->l);
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(new));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(new));
goto end;
}
new->l -= padlen;
Expand Down Expand Up @@ -2157,7 +2157,7 @@ oakley_do_decrypt(iph1, msg, ivdp, ivep)
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"decrypted.\n"));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(buf));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(buf));

#ifdef HAVE_PRINT_ISAKMP_C
isakmp_printpacket(buf, iph1->remote, iph1->local, 1);
Expand Down Expand Up @@ -2222,7 +2222,7 @@ oakley_do_encrypt(iph1, msg, ivep, ivp)
else
buf->v[len + padlen - 1] = padlen;

YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(buf));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(buf));

/* do encrypt */
if (iph1->approval->enctype > ARRAYLEN(cipher)
Expand All @@ -2236,7 +2236,7 @@ oakley_do_encrypt(iph1, msg, ivep, ivp)
plog(logp, LOCATION, NULL,
"encrypt(%s).\n",
cipher[iph1->approval->enctype].name));
YIPSDEBUG(DEBUG_DCRYPT,
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"with key: ");
PVDUMP(iph1->key));
Expand All @@ -2247,7 +2247,7 @@ oakley_do_encrypt(iph1, msg, ivep, ivp)
if (new == NULL)
goto end;

YIPSDEBUG(DEBUG_DCRYPT,
YIPSDEBUG(DEBUG_CRYPT,
plog(logp, LOCATION, NULL,
"encrypted payload by IV: ");
PVDUMP(ivep));
Expand All @@ -2257,7 +2257,7 @@ oakley_do_encrypt(iph1, msg, ivep, ivp)
memcpy(ivp->v, (caddr_t)&new->v[new->l - CBC_BLOCKLEN], CBC_BLOCKLEN);

YIPSDEBUG(DEBUG_CRYPT, plog(logp, LOCATION, NULL, "save IV for next: "));
YIPSDEBUG(DEBUG_DCRYPT, PVDUMP(ivp));
YIPSDEBUG(DEBUG_CRYPT, PVDUMP(ivp));

/* create new buffer */
len = sizeof(struct isakmp) + new->l;
Expand Down
6 changes: 3 additions & 3 deletions kame/kame/racoon/sockmisc.c
Expand Up @@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* YIPS @(#)$Id: sockmisc.c,v 1.10 2000/05/24 09:58:54 itojun Exp $ */
/* YIPS @(#)$Id: sockmisc.c,v 1.11 2000/06/27 16:56:35 sakane Exp $ */

#include <sys/types.h>
#include <sys/param.h>
Expand Down Expand Up @@ -325,7 +325,7 @@ recvfromto(s, buf, buflen, flags, from, fromlen, to, tolen)
}
}

YIPSDEBUG(DEBUG_NET,
YIPSDEBUG(DEBUG_NOTIFY,
plog(logp, LOCATION, to,
"received packets from %s\n", saddr2str(from)));

Expand Down Expand Up @@ -357,7 +357,7 @@ sendfromto(s, buf, buflen, src, dst)
return -1;
}

YIPSDEBUG(DEBUG_NET,
YIPSDEBUG(DEBUG_NOTIFY,
plog(logp, LOCATION, NULL,
"sockname %s\n", saddr2str((struct sockaddr *)&ss));
plog(logp, LOCATION, src,
Expand Down

0 comments on commit 64eb666

Please sign in to comment.