⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkt_clen.c

📁 早期freebsd实现
💻 C
字号:
/* * $Source: /usr/src/kerberosIV/krb/RCS/pkt_clen.c,v $ * $Author: kfall $ * * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute * of Technology. * * For copying and distribution information, please see the file * <mit-copyright.h>. */#ifndef lintstatic char *rcsid_pkt_clen_c ="$Header: /usr/src/kerberosIV/krb/RCS/pkt_clen.c,v 4.8 90/06/25 20:57:05 kfall Exp $";#endif /* lint */#include <mit-copyright.h>#include <des.h>#include <krb.h>#include <prot.h>extern int krb_debug;extern int swap_bytes;/* * Given a pointer to an AUTH_MSG_KDC_REPLY packet, return the length of * its ciphertext portion.  The external variable "swap_bytes" is assumed * to have been set to indicate whether or not the packet is in local * byte order.  pkt_clen() takes this into account when reading the * ciphertext length out of the packet. */pkt_clen(pkt)    KTEXT pkt;{    static unsigned short temp,temp2;    int clen = 0;    /* Start of ticket list */    unsigned char *ptr = pkt_a_realm(pkt) + 10	+ strlen((char *)pkt_a_realm(pkt));    /* Finally the length */    bcopy((char *)(++ptr),(char *)&temp,2); /* alignment */    if (swap_bytes) {        /* assume a short is 2 bytes?? */        swab((char *)&temp,(char *)&temp2,2);        temp = temp2;    }    clen = (int) temp;    if (krb_debug)	printf("Clen is %d\n",clen);    return(clen);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -