home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / tripwire / part06 < prev    next >
Encoding:
Text File  |  1993-04-19  |  67.5 KB  |  2,116 lines

  1. Newsgroups: comp.sources.unix
  2. From: spaf@cs.purdue.edu (Gene Spafford)
  3. Subject: v26i178: tripwire - security integrity monitor, Part06/08
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: spaf@cs.purdue.edu (Gene Spafford)
  8. Posting-Number: Volume 26, Issue 178
  9. Archive-Name: tripwire/part06
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 6 (of 8)."
  18. # Contents:  tripwire-1.0 tripwire-1.0/configs tripwire-1.0/include
  19. #   tripwire-1.0/man tripwire-1.0/sigs tripwire-1.0/sigs/crc
  20. #   tripwire-1.0/sigs/md2 tripwire-1.0/src tripwire-1.0/man/tripwire.8
  21. #   tripwire-1.0/man/tw.config.5 tripwire-1.0/src/Makefile
  22. #   tripwire-1.0/sigs/md2/md2.c tripwire-1.0/Changelog
  23. #   tripwire-1.0/Ported tripwire-1.0/sigs/crc/crc.c
  24. #   tripwire-1.0/configs/tw.conf.hp2 tripwire-1.0/include/config.h
  25. # Wrapped by spaf@uther.cs.purdue.edu on Tue Nov  3 16:31:56 1992
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test ! -d 'tripwire-1.0' ; then
  28.     echo shar: Creating directory \"'tripwire-1.0'\"
  29.     mkdir 'tripwire-1.0'
  30. fi
  31. if test ! -d 'tripwire-1.0/configs' ; then
  32.     echo shar: Creating directory \"'tripwire-1.0/configs'\"
  33.     mkdir 'tripwire-1.0/configs'
  34. fi
  35. if test ! -d 'tripwire-1.0/include' ; then
  36.     echo shar: Creating directory \"'tripwire-1.0/include'\"
  37.     mkdir 'tripwire-1.0/include'
  38. fi
  39. if test ! -d 'tripwire-1.0/man' ; then
  40.     echo shar: Creating directory \"'tripwire-1.0/man'\"
  41.     mkdir 'tripwire-1.0/man'
  42. fi
  43. if test ! -d 'tripwire-1.0/sigs' ; then
  44.     echo shar: Creating directory \"'tripwire-1.0/sigs'\"
  45.     mkdir 'tripwire-1.0/sigs'
  46. fi
  47. if test ! -d 'tripwire-1.0/sigs/crc' ; then
  48.     echo shar: Creating directory \"'tripwire-1.0/sigs/crc'\"
  49.     mkdir 'tripwire-1.0/sigs/crc'
  50. fi
  51. if test ! -d 'tripwire-1.0/sigs/md2' ; then
  52.     echo shar: Creating directory \"'tripwire-1.0/sigs/md2'\"
  53.     mkdir 'tripwire-1.0/sigs/md2'
  54. fi
  55. if test ! -d 'tripwire-1.0/src' ; then
  56.     echo shar: Creating directory \"'tripwire-1.0/src'\"
  57.     mkdir 'tripwire-1.0/src'
  58. fi
  59. if test -f 'tripwire-1.0/man/tripwire.8' -a "${1}" != "-c" ; then 
  60.   echo shar: Will not clobber existing file \"'tripwire-1.0/man/tripwire.8'\"
  61. else
  62. echo shar: Extracting \"'tripwire-1.0/man/tripwire.8'\" \(7596 characters\)
  63. sed "s/^X//" >'tripwire-1.0/man/tripwire.8' <<'END_OF_FILE'
  64. X.\" $Id: tripwire.8,v 1.2 92/11/03 02:34:17 genek Exp $
  65. X.\"
  66. X.TH TRIPWIRE 8 "October 14, 1992"
  67. X.SH NAME
  68. Xtripwire \- a file integrity checker for UNIX systems
  69. X.SH SYNOPSIS
  70. X.B tripwire
  71. X[ 
  72. X.I options \fP...\fI
  73. X] 
  74. X.SH DESCRIPTION
  75. X.LP
  76. XTripwire is a system file integrity checker, a utility that
  77. Xcompares a designated set of files and directories against
  78. Xinformation stored in a previously generated database.
  79. XAdded or deleted files are flagged and reported, as are any files
  80. Xthat have changed from its previously recorded state in the
  81. Xdatabase.  When run against system files on a regular basis,
  82. Xchanges in critical system files would be spotted at the next
  83. Xtime-interval when Tripwire is run, so damage control measures
  84. Xcan be implemented immediately.
  85. X.LP
  86. XUsing Tripwire, system administrators can conclude with an
  87. Xextremely high degree of certainty that a given set of files
  88. Xremain untouched from unauthorized modifications, provided the
  89. Xprogram and database are appropriately protected (e.g., stored on
  90. Xread-only media).
  91. X.LP
  92. XTripwire uses message-digest algorithms (cryptographic checksums)
  93. Xto detect changes in a hard-to-spoof manner.  This should be able
  94. Xto detect significant changes to critical files, including those
  95. Xcaused by insertion of backdoors or viruses.  Tripwire also
  96. Xmonitors changes to file permissions, modification times, and
  97. Xother significant changes to inodes as selected by the system
  98. Xadministrator on a per-file/directory basis.
  99. X.LP
  100. XTripwire runs in one of three modes: Database Generation,
  101. XDatabase Update, or Integrity Checking mode.  In Database
  102. XGeneration mode, Tripwire initializes the database based upon the
  103. Xthe entries enumerated in the \fItw.config\fP file.  Database
  104. XUpdate mode provides incremental database update functionality on
  105. Xa per-file/directory basis, to obviate having to regenerate the
  106. Xentire database every time a file changes.  Finally, Integrity
  107. XChecking modes provides the tripwire-like functionality which
  108. Xcompares all files in the database file against those currently
  109. Xresiding on the filesystem and reports any changes.
  110. X.SH OPTIONS
  111. X.LP
  112. XWhen run without any arguments, \fItripwire\fP runs in Integrity
  113. XChecking mode.
  114. X.TP 20
  115. X.B \-initialize
  116. XDatabase Generation mode.  Creates the database which is used for
  117. Xall subsequent Integrity Checking runs.
  118. X.TP
  119. X.B -update entry
  120. XDatabase Update mode.  This mode updates the specified \fIentry\fP
  121. Xin the database.  If \fIentry\fP is a file, only that file is
  122. Xupdates.  If \fIentry\fP is a directory, the directory and all of
  123. Xits children are updated.  If \fIentry\fP is also a
  124. X\fItw.config\fP file, the entire entry in the database is
  125. Xupdated.
  126. X.TP
  127. X.B \-d dbasefile
  128. XReads the database information from the specified file
  129. X\fIdbasefile\fP.  \fIstdin\fP can specified by ``-d -''.
  130. X.TP
  131. X.B \-c configfile
  132. XRead the configuration information from the specified file
  133. X\fIconfigfile\fP.  \fIstdin\fP can specified by ``-c -''.
  134. X.TP
  135. X.B \-D\fIvar\fP=\fIvalue\fP
  136. XDefines the \fItw.config\fP variable \fIvar\fP to \fIvalue\fP. 
  137. X(As if \fI@@define\fP were used.)
  138. X.TP
  139. X.B \-U\fIvar\fP
  140. XUndefine the \fItw.config\fP variable \fIvar\fP. 
  141. X(As if \fI@@undef\fP were used.)
  142. X.TP
  143. X.B \-i #|all
  144. XIgnore the specified signature, and skip it when comparing
  145. Xagainst database entries.  If \fIall\fP is specified, no
  146. Xsignatures are collected or compared.
  147. X.TP
  148. X.B \-E
  149. XPrints out preprocessed \fItw.config\fP file to \fIstdout\fP.
  150. X.TP
  151. X.B \-q
  152. XQuiet mode.  Skips Phase 5 which lists all the {\fIobserved,
  153. Xexpected\fP} pairs for each changed file.
  154. X.TP
  155. X.B \-v
  156. XVerbose mode.
  157. X.TP
  158. X.B \-version
  159. XPrints out version information.
  160. X.SH DATABASE GENERATION MODE
  161. X.LP
  162. XIn Database Generation mode, \fItripwire\fP will create the
  163. Xdatabase file based upon the entries in \fItw.config\fP.  The
  164. Xname of this database file is defined at compile-time in
  165. X\fIconfig.h\fP \- defaults to \fItw.db_[hostname]\fP.  The
  166. Xgenerated database is placed in \fB./databases\fP directory, and
  167. Xmust be moved to the target directory manually.
  168. X.LP
  169. XNote that you must manually move this file to your database
  170. Xdirectory.  This is because the default database directory should
  171. Xbe a read-only file system.  
  172. X.SH DATABASE UPDATE MODE
  173. X.LP
  174. XIn Database Update mode, \fItripwire\fP updates only the
  175. Xspecified subset of files in the database.  The updated database
  176. Xis read as normal, and the database with the updated entries is
  177. Xwritten out to the \fB./Databases\fP directory, as well as a
  178. Xbackup of the original database.
  179. X.LP
  180. X\fItripwire\fP in Database Update mode requires one argument,
  181. Xwhich is used as an \fIentry\fP.  The \fIentry\fP argument
  182. Xspecifies which file or directory is to be updated, and is interpreted
  183. Xsimilar to \fItw.config\fP entries.  If the argument is a
  184. Xfilename, only that file is updated in the database.  Similarly,
  185. Xif the argument is a directory name, the directory and its
  186. Xchildren are updated.
  187. X.LP
  188. XIf the argument is also an entry in the \fItw.config\fP file, the
  189. Xentire entry is updated.  Running \fItripwire\fP in this fashion
  190. Xwill flag files that have been added or deleted in this entry.
  191. X.SH INTEGRITY CHECKING MODE
  192. X.LP
  193. XIn Integrity Checking mode, \fItripwire\fP reads in the
  194. Xpreviously generated database, and then rebuilds a new database
  195. Xto reflect the current files.  \fItripwire\fP reports any files 
  196. Xthat have been added or deleted, and then reports any files that
  197. Xhave changed.
  198. X.LP
  199. XIn the \fItw.config\fP file, there is a description of which attributes
  200. Xcan change that can be safely ignored.  \fItripwire\fP applies these 
  201. Xignore-rules to dismiss which changes can be safely ignored.  
  202. X.LP
  203. XEach file that differs from the information stored in the database
  204. Xis considered ``changed.''  However, only the changes that remain 
  205. Xafter the ignore-rules are applied are displayed.  For each change,
  206. Xthe expected and actual information is printed.  For instance:
  207. X.LP
  208. X.Ps
  209. X.ps -2
  210. X.vs -2
  211. X2:30am (mentor) 985 % tripwire
  212. X### Phase 1:   Reading configuration file
  213. X### Phase 2:   Generating file list
  214. X### Phase 3:   Creating file information database
  215. X### Phase 4:   Searching for inconsistencies
  216. X###
  217. X###                     Total files scanned:            82
  218. X###                           Files added:              0
  219. X###                           Files deleted:            0
  220. X###                           Files changed:            80
  221. X###
  222. X###                     After applying rules:
  223. X###                           Changes discarded:        79
  224. X###                           Changes remaining:        1
  225. X###
  226. Xchanged: -rw------- genek        4433 Oct 13 02:30:34 1992 /tmp/genek/tripwire-0.92/config.h
  227. X### Phase 5:   Generating observed/expected pairs for changed files
  228. X###
  229. X### Attr        Observed (what it is)         Expected (what it should be)
  230. X### =========== ============================= =============================
  231. X/tmp/genek/tripwire-0.92/config.h
  232. X       st_size: 4441                          4433
  233. X    md5 (sig1): 0aqL1O06C3Fj1YBXz3.CPdcb      0cPX1H.DYS.s1vZdKD.ELMDR
  234. X snefru (sig2): 0PcgcK/MZvEm.8pIWe.Gbnn/      /8VoJv1JcoUA0NvoGN.k3P6E
  235. X  crc32 (sig3): .EHA6x                        /OuGNV
  236. X  crc16 (sig4): ...9/q                        ...6yu
  237. X    md4 (sig5): /hQ0sU.UEbJo.UR4VZ/mNG/h      .UR4VZ/mNG/h/VSG/W/Z643k
  238. X    md2 (sig6): .hLwjb.VRA0O.Z72y90xTYqA      1LR0Gg1l.vqB0.1g330Pi8/p
  239. X.ps
  240. X.vs
  241. X.Pe
  242. X.SH ENVIRONMENT
  243. XNone.
  244. X.SH BUGS
  245. XThis manual page is still not self-contained yet \- users still
  246. Xneed to read the design document to really understand the
  247. Xutility.
  248. X.SH SEE ALSO
  249. X.IR "Tripwire Design Document" ,
  250. Xby Gene Kim and Eugene Spafford
  251. X.SH AUTHORS
  252. X.nf
  253. XGene Kim
  254. XPurdue University
  255. Xgenek@mentor.cc.purdue.edu
  256. X
  257. XEugene Spafford
  258. XPurdue University
  259. Xspaf@cs.purdue.edu
  260. X.fi
  261. X
  262. END_OF_FILE
  263. if test 7596 -ne `wc -c <'tripwire-1.0/man/tripwire.8'`; then
  264.     echo shar: \"'tripwire-1.0/man/tripwire.8'\" unpacked with wrong size!
  265. fi
  266. # end of 'tripwire-1.0/man/tripwire.8'
  267. fi
  268. if test -f 'tripwire-1.0/man/tw.config.5' -a "${1}" != "-c" ; then 
  269.   echo shar: Will not clobber existing file \"'tripwire-1.0/man/tw.config.5'\"
  270. else
  271. echo shar: Extracting \"'tripwire-1.0/man/tw.config.5'\" \(7470 characters\)
  272. sed "s/^X//" >'tripwire-1.0/man/tw.config.5' <<'END_OF_FILE'
  273. X.\" $Id: tw.config.5,v 1.1.1.2 92/11/02 18:20:25 genek Exp $
  274. X.\"
  275. X.TH TW.CONFIG 5 "October 5, 1992"
  276. X.SH NAME
  277. Xtw.config \- configuration file for Tripwire
  278. X.SH SYNOPSIS
  279. Xtw.config
  280. X.SH DESCRIPTION
  281. XThe \fItw.config\fP file contains the list of files and
  282. Xdirectories that are scanned by Tripwire.  Information on these
  283. Xfiles are collected and stored in the \fItw_db\fP database file.
  284. X.LP
  285. XThe first section describes the entry format in the
  286. X\fItw.config\fP file which describes the files monitored
  287. Xby Tripwire.  The second section describes the proprocessing
  288. Xdirectives that Tripwire provides.  These directives, which
  289. Xprovide similar functionality of the C preprocessor and M4 macro
  290. Xprocessor, allow Tripwire to make bindings at run-time.  This
  291. Xallows system administrators to use common \fItw.config\fP files
  292. Xacross multiple machines \- or even across an entire site.
  293. X.SH ENTRY FORMAT
  294. X.LP
  295. XEach entry in \fItw.config\fP is single line in the following form:
  296. X.sp
  297. X.RS
  298. X\fBFormat\fP:     \fI[!|=] entry [ignore-flags][template]\fP
  299. X.RE
  300. X.RS
  301. X.Pe
  302. X.TP 12
  303. X.I entry
  304. XAn \fIentry\fP is the absolute pathname of a file or a directory. 
  305. XWithout any prefixes, the \fIentry\fP is added to the list of files
  306. Xto be scanned.
  307. X.RS
  308. X.TP 
  309. X.I !
  310. XInclusive prune.  Prunes \fIentry\fP from the list of files to be
  311. Xscanned.  If \fIentry\fP is a file, the file is removed list of
  312. Xfiles.  If \fIentry\fP is a directory, the directory and all of
  313. Xits children are removed from the list of files.
  314. X.TP
  315. X.I =
  316. XExclusive prune.  Does not prune \fIentry\fP, but does prune its
  317. Xchildren.  This has no effect if \fIentry\fP is a file.  This
  318. Xoption is useful for monitoring directories with transient files
  319. X(e.g., /tmp and /var/tmp).
  320. X.RE
  321. X.TP
  322. X.I ignore-flags
  323. X\fIignore-flags\fP describe inode and file attributes.  \fIignore-flags\fP
  324. Xeither specifies Tripwire to ignore changes in a specific attribute, or to
  325. Xreport them.  \fIignore-flags\fP are provided in the form:
  326. X.I
  327. X[ [+|-][pinugsam12] ... ]
  328. X.RS
  329. X.TP 4
  330. X.I -
  331. Xignore the following attributes     
  332. X.TP
  333. X.I +
  334. Xdo not ignore the following attributes
  335. X.TP
  336. X.I p
  337. Xpermission and file mode bits     
  338. X.TP
  339. X.I i
  340. Xinode number            
  341. X.TP
  342. X.I n
  343. Xnumber of links (i.e., inode reference count)    
  344. X.TP
  345. X.I u
  346. Xuser id of owner            
  347. X.TP
  348. X.I g
  349. Xgroup id of owner            
  350. X.TP
  351. X.I s
  352. Xsize of file
  353. X.TP
  354. X.I a
  355. Xaccess timestamp
  356. X.TP
  357. X.I m
  358. Xmodification timestamp
  359. X.TP
  360. X.I c
  361. Xinode creation timestamp
  362. X.TP
  363. X.I 0
  364. Xsignature 0 \- null signature
  365. X.TP
  366. X.I 1
  367. Xsignature 1 \- MD5, the RSA Data Security, Inc. Message Digesting Algorithm.
  368. X.TP
  369. X.I 2
  370. Xsignature 2 \- Snefru, the Xerox Secure Hash Function.
  371. X.TP
  372. X.I 3
  373. Xsignature 3 \- CRC-32, 32-bit Cyclic Redundancy Check.
  374. X.TP
  375. X.I 4
  376. Xsignature 4 \- CRC-16, the standard (non-CCITT) 16-bit Cyclic Redundancy Check.
  377. X.TP
  378. X.I 5
  379. Xsignature 5 \- MD4, the RSA Data Security, Inc. Message Digesting Algorithm.
  380. X.TP
  381. X.I 6
  382. Xsignature 6 \- MD2, the RSA Data Security, Inc. Message Digesting Algorithm.
  383. X.TP
  384. X.I 7
  385. Xsignature 7 \- null signature (reserved for future expansion)
  386. X.TP
  387. X.I 8
  388. Xsignature 8 \- null signature (reserved for future expansion)
  389. X.TP
  390. X.I 9
  391. Xsignature 9 \- null signature (reserved for future expansion)
  392. X.RE
  393. X.TP
  394. X.I templates
  395. X\fItemplate\fP are predefined sets of \fIignore-flags\fP that are
  396. Xthe most useful for most system administration and monitoring
  397. Xsetups.
  398. X.RE
  399. X.LP
  400. XThe following templates have been pre-defined to make these long ignore
  401. Xmask descriptions unnecessary.
  402. X.RS
  403. X.nf
  404. X.TP 6
  405. X.I R 
  406. X[R]ead-only (+pinugsm12-a) \fI(default)\fP
  407. X.TP
  408. X.I L 
  409. X[L]og file (+pinug-sam12)
  410. X.TP
  411. X.I N
  412. Xignore [N]othing (+pinusgsamc12)
  413. X.TP
  414. X.I E
  415. Xignore [E]verything (-pinusgsamc12)
  416. X.fi
  417. X.RE
  418. X.LP
  419. XBy default, Tripwire uses the R template.  Since it applies the
  420. Xset of \fIignore-flags\fP {+pinugsm12-a}, Tripwire will ignore
  421. Xany changed files where only the access time stamp has changed.
  422. X.LP
  423. XYou can combine the use of templates with ignore-flag modifiers.
  424. XThe following entry monitors only changes in user-id and group-id
  425. Xinformation.
  426. X.Ps
  427. X/etc/lp    E+ug
  428. X.Pe
  429. X.SH ENTRY EXAMPLES
  430. X.LP
  431. XThe following entry will scan all the files in /etc, and report
  432. Xany changes in mode bits, inode number, reference count, uid,
  433. Xgid, modification and creation timestamp, and the signatures.
  434. XHowever, it will ignore any changes in the access timestamp.
  435. X.Ps
  436. X/etc    +pinugsm12-a
  437. X.Pe
  438. X.LP
  439. XThe following example shows a very simple \fItw.config\fP file that 
  440. Xmonitors a subset of the /etc directory.
  441. X.Ps
  442. X/etc        R    # all system files
  443. X!/etc/lp    R    # ...but not those logs
  444. X=/tmp        N    # just the directory, not its files
  445. X.Pe
  446. X.LP
  447. XNote the difference between pruning (via "!") and ignoring everything
  448. X(via "E" template):  Ignoring everything in a directory still monitors
  449. Xfor added and deleted files.  Pruning a directory will prevent Tripwire
  450. Xfrom even looking in the specified directory.
  451. X.LP
  452. X.I Hint: 
  453. XTripwire running slowly?  Modify your tripwire.config entries to
  454. Xignore signatures 2 through 9 when this computationally-exorbitant 
  455. Xprotection is not needed.  (See README and design document for further
  456. Xdetails.)
  457. X.SH PREPROCESSOR
  458. X.LP
  459. XTripwire incorporates a general purpose preprocessor that parses
  460. Xthe \fItw.config\fP in one-pass.  Available preprocessing directives
  461. Xinclude file inclusion, macro defines, conditionals based upon
  462. Xhostname or macros, and on-the-fly macro substitution.  These directives
  463. Xprovide C-preprocessor and m4-like capabilities.
  464. X.LP
  465. XThe authors envision multiple machines sharing the same \fItw.config\fP
  466. Xfile by using header files and conditionals.
  467. X.RS
  468. X.TP 30
  469. X.I @@ifhost HOSTNAME    
  470. Xincludes text until matching \fI@@endif\fPd if the machine
  471. Xhostname matches the specified \fIHOSTNAME\fP.
  472. X.TP
  473. X.I @@ifnhost HOSTNAME
  474. Xincludes text until matching \fI@@endif\fP if the machine
  475. Xhostname does not match the specified \fIHOSTNAME\fP.
  476. X.TP
  477. X.I @@else 
  478. Xprovides if-else semantics to preprocessor.
  479. X.TP
  480. X.I @@define VAR STRING
  481. Xdefines variable \fIVAR\fP to \fISTRING\fP.  If the second argument
  482. Xis not provides, then a null-string is assigned to \fIVAR\fP.
  483. X.TP
  484. X.I @@undef VAR
  485. Xclears definition of variable \fIVAR\fP.
  486. X.TP
  487. X.I @@ifdef VAR
  488. Xincludes text until matching \fI@@endif\fP if the variable \fIVAR\fP
  489. Xhas been defined.
  490. X.TP
  491. X.I @@ifndef VAR
  492. Xincludes text until matching \fI@@endif\fP if the variable \fIVAR\fP
  493. Xhas not been defined.
  494. X.TP
  495. X.I @@endif
  496. Xcloses up \fI@@ifhost\fP, \fI@@ifnhost\fP, \fI@@ifdef\fP, and
  497. X\fI@@ifndef\fP.
  498. X.TP
  499. X.I @@include "FILENAME"    
  500. Xreads in the specified source file.  Quotes are optional.
  501. X.TP
  502. X.I @@VAR
  503. Xsubstitutes the definition of (\fIVAR\fP) with the
  504. X\fI@@define\fP'ed value.
  505. X.RE
  506. X.LP
  507. X.I Example:
  508. XA host-dependent inclusion can be specified many ways so tw.config
  509. Xfiles can be shared among multiple machines.  So, if the machine 
  510. X"mentor.cc.purdue.edu" is the only machine that has a certain file,
  511. Xyou could use:
  512. X.Ps
  513. X@@ifhost mentor.cc.purdue.edu
  514. X/etc/tw.log.mentor    R
  515. X@@endif
  516. X
  517. X@@define ARCHIVE    +pinugsamc-12
  518. X/etc/tw.log        @@ARCHIVE
  519. X.Pe
  520. X.SH CAVEATS
  521. X.LP
  522. XAlthough \fItripwire\fP provides hooks for ten different
  523. Xsignature routines, using all ten would certainly be overkill in
  524. Xalmost any imaginable situation.  However, having up to ten
  525. Xsignature routines in your signature arsenal allows system
  526. Xadministrators considerable flexibility in finding the balance
  527. Xbetween performance and security for their specific site.  This
  528. Xis the reason for supplying CRC-16 and CRC-32 which are trivially
  529. Xsimple to crack.  These routines are not secure, but they are
  530. Xsignificantly faster than the cryptographic checksumming
  531. Xroutines.
  532. X.SH AUTHOR
  533. X.nf
  534. XGene Kim
  535. XPurdue University
  536. Xgenek@mentor.cc.purdue.edu
  537. X
  538. XEugene Spafford
  539. XPurdue University
  540. Xspaf@cs.purdue.edu
  541. X.fi
  542. X
  543. END_OF_FILE
  544. if test 7470 -ne `wc -c <'tripwire-1.0/man/tw.config.5'`; then
  545.     echo shar: \"'tripwire-1.0/man/tw.config.5'\" unpacked with wrong size!
  546. fi
  547. # end of 'tripwire-1.0/man/tw.config.5'
  548. fi
  549. if test -f 'tripwire-1.0/src/Makefile' -a "${1}" != "-c" ; then 
  550.   echo shar: Will not clobber existing file \"'tripwire-1.0/src/Makefile'\"
  551. else
  552. echo shar: Extracting \"'tripwire-1.0/src/Makefile'\" \(7439 characters\)
  553. sed "s/^X//" >'tripwire-1.0/src/Makefile' <<'END_OF_FILE'
  554. X# $Id: Makefile,v 1.2 92/11/03 02:35:09 genek Exp $
  555. X#
  556. X#     Tripwire build
  557. X#
  558. X
  559. XOFILES =     config.parse.o main.o list.o ignorevec.o dbase.build.o \
  560. X        utils.o preen.o preen.interp.o preen.report.o \
  561. X        nullsig.o config.prim.o dbase.update.o \
  562. X        config.pre.o \
  563. X        $(OSIGS)
  564. X
  565. XOSIGS      = $(OSIG1) $(OSIG2) $(OSIG3) $(OSIG4) $(OSIG5) $(OSIG6)
  566. X
  567. XSIGDIR      = ../sigs
  568. XSIG1DIR   = $(SIGDIR)/md5
  569. XSIG2DIR   = $(SIGDIR)/snefru
  570. XSIG3DIR   = $(SIGDIR)/crc32
  571. XSIG4DIR   = $(SIGDIR)/crc
  572. XSIG5DIR   = $(SIGDIR)/md4
  573. XSIG6DIR   = $(SIGDIR)/md2
  574. X
  575. XOSIG1      = $(SIG1DIR)/md5wrapper.o $(SIG1DIR)/md5.o
  576. XOSIG2      = $(SIG2DIR)/snefru.o
  577. XOSIG3      = $(SIG3DIR)/crc32.o
  578. XOSIG4      = $(SIG4DIR)/crc.o
  579. XOSIG5      = $(SIG5DIR)/md4.o $(SIG5DIR)/md4wrapper.o
  580. XOSIG6      = $(SIG6DIR)/md2.o $(SIG6DIR)/md2wrapper.o
  581. X
  582. XCFILES =     config.parse.c main.c list.c ignorevec.c dbase.build.c \
  583. X        utils.c preen.c preen.interp.c preen.report.c \
  584. X        nullsig.c config.prim.c dbase.update.c \
  585. X        config.pre.c \
  586. X        $(CSIGS)
  587. X
  588. XCSIGS      = $(CSIG1) $(CSIG2) $(CSIG3) $(CSIG4) $(CSIG5) $(CSIG6)
  589. X
  590. XCSIG1      = $(SIG1DIR)/md5wrapper.c $(SIG1DIR)/md5.c
  591. XCSIG2      = $(SIG2DIR)/snefru.c
  592. XCSIG3      = $(SIG3DIR)/crc32.c
  593. XCSIG4      = $(SIG4DIR)/crc.c
  594. XCSIG5      = $(SIG5DIR)/md4.c $(SIG5DIR)/md4wrapper.c
  595. XCSIG6      = $(SIG6DIR)/md2.c $(SIG6DIR)/md2wrapper.c
  596. X
  597. X###
  598. X
  599. Xall:    tripwire sigfetch
  600. X
  601. Xtripwire:    $(P) $(OFILES) 
  602. X    $(CC) $(CFLAGS) -o $@ $(OFILES) $(LIBS)
  603. X
  604. X$(OSIG1):    ../include/byteorder.h
  605. X    (cd $(SIG1DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  606. X$(OSIG2):    ../include/byteorder.h
  607. X    (cd $(SIG2DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  608. X$(OSIG3):    ../include/byteorder.h
  609. X    (cd $(SIG3DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  610. X$(OSIG4):    ../include/byteorder.h
  611. X    (cd $(SIG4DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  612. X$(OSIG5):    ../include/byteorder.h
  613. X    (cd $(SIG5DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  614. X$(OSIG6):    ../include/byteorder.h
  615. X    (cd $(SIG6DIR); make CC="$(CC)" CFLAGS="$(CFLAGS) -I. -I..")
  616. X
  617. X../include/byteorder.h ../include/inode.h:
  618. X    (cd ../aux; make CC=$(CC) CFLAGS="$(CFLAGS)"  \
  619. X    LDFLAGS="$(LDFLAGS)" CPP="$(CPP)" SHELL=$(SHELL) all)
  620. X
  621. X
  622. X# need $(LDFLAGS) because this may interact with the way nullsig.o and
  623. X# utils.o were compiled
  624. Xsigfetch:    $(OSIGS) sigfetch.c
  625. X    $(CC) $(CFLAGS) -o sigfetch sigfetch.c $(OSIGS) nullsig.o utils.o $(LIBS)
  626. X    
  627. Xconfig.lex.c:    config.pre.l
  628. X    $(LEX) config.pre.l
  629. X    mv lex.yy.c config.lex.c
  630. X
  631. Xconfig.pre.c:    config.lex.c config.pre.y
  632. X    $(YACC) config.pre.y
  633. X    sed 's/lex\.yy\.c/config.lex.c/' < y.tab.c > config.pre.c 
  634. X    rm y.tab.c
  635. X
  636. X.c.o:
  637. X    $(CC) $(CFLAGS) -c $<
  638. X
  639. Xinstall:    tripwire
  640. X    $(INSTALL) tripwire $(TARGET)
  641. X
  642. Xclean:
  643. X    -rm -f $(OFILES) config.lex.c config.pre.c y.tab.c lex.yy.c  
  644. X
  645. Xclobber:    clean
  646. X    -rm -f tripwire sigfetch
  647. X
  648. X#  Some other dependencies
  649. X
  650. Xconfig.lex.o: config.lex.c
  651. Xconfig.parse.o: config.parse.c
  652. Xconfig.parse.o: ../include/config.h
  653. Xconfig.parse.o: ../include/list.h
  654. Xconfig.parse.o: ../include/tripwire.h
  655. Xconfig.parse.o: ../sigs/snefru/snefru.h
  656. Xconfig.parse.o: ../sigs/md5/md5.h
  657. Xconfig.parse.o: ../sigs/crc32/crc32.h
  658. Xconfig.parse.o: ../sigs/crc/crc.h
  659. Xconfig.parse.o: ../sigs/md2/md2.h
  660. Xconfig.parse.o: ../sigs/md4/md4.h
  661. Xconfig.parse.o: ../include/inode.h
  662. Xconfig.pre.o: config.pre.c
  663. Xconfig.pre.o: ../include/config.h
  664. Xconfig.pre.o: ../include/list.h
  665. Xconfig.pre.o: ../include/tripwire.h
  666. Xconfig.pre.o: ../sigs/snefru/snefru.h
  667. Xconfig.pre.o: ../sigs/md5/md5.h
  668. Xconfig.pre.o: ../sigs/crc32/crc32.h
  669. Xconfig.pre.o: ../sigs/crc/crc.h
  670. Xconfig.pre.o: ../sigs/md2/md2.h
  671. Xconfig.pre.o: ../sigs/md4/md4.h
  672. Xconfig.pre.o: ../include/inode.h
  673. Xconfig.pre.o: ./config.lex.c
  674. Xconfig.prim.o: config.prim.c
  675. Xconfig.prim.o: ../include/config.h
  676. Xconfig.prim.o: ../include/tripwire.h
  677. Xconfig.prim.o: ../sigs/snefru/snefru.h
  678. Xconfig.prim.o: ../sigs/md5/md5.h
  679. Xconfig.prim.o: ../sigs/crc32/crc32.h
  680. Xconfig.prim.o: ../sigs/crc/crc.h
  681. Xconfig.prim.o: ../sigs/md2/md2.h
  682. Xconfig.prim.o: ../sigs/md4/md4.h
  683. Xconfig.prim.o: ../include/inode.h
  684. Xconfig.prim.o: ../include/list.h
  685. Xdbase.build.o: dbase.build.c
  686. Xdbase.build.o: ../include/config.h
  687. Xdbase.build.o: ../include/list.h
  688. Xdbase.build.o: ../include/tripwire.h
  689. Xdbase.build.o: ../sigs/snefru/snefru.h
  690. Xdbase.build.o: ../sigs/md5/md5.h
  691. Xdbase.build.o: ../sigs/crc32/crc32.h
  692. Xdbase.build.o: ../sigs/crc/crc.h
  693. Xdbase.build.o: ../sigs/md2/md2.h
  694. Xdbase.build.o: ../sigs/md4/md4.h
  695. Xdbase.build.o: ../include/inode.h
  696. Xdbase.update.o: dbase.update.c
  697. Xdbase.update.o: ../include/config.h
  698. Xdbase.update.o: ../include/list.h
  699. Xdbase.update.o: ../include/tripwire.h
  700. Xdbase.update.o: ../sigs/snefru/snefru.h
  701. Xdbase.update.o: ../sigs/md5/md5.h
  702. Xdbase.update.o: ../sigs/crc32/crc32.h
  703. Xdbase.update.o: ../sigs/crc/crc.h
  704. Xdbase.update.o: ../sigs/md2/md2.h
  705. Xdbase.update.o: ../sigs/md4/md4.h
  706. Xdbase.update.o: ../include/inode.h
  707. Xignorevec.o: ignorevec.c
  708. Xignorevec.o: ../include/config.h
  709. Xignorevec.o: ../include/list.h
  710. Xignorevec.o: ../include/tripwire.h
  711. Xignorevec.o: ../sigs/snefru/snefru.h
  712. Xignorevec.o: ../sigs/md5/md5.h
  713. Xignorevec.o: ../sigs/crc32/crc32.h
  714. Xignorevec.o: ../sigs/crc/crc.h
  715. Xignorevec.o: ../sigs/md2/md2.h
  716. Xignorevec.o: ../sigs/md4/md4.h
  717. Xignorevec.o: ../include/inode.h
  718. Xlist.o: list.c
  719. Xlist.o: ../include/config.h
  720. Xlist.o: ../include/list.h
  721. Xmain.o: main.c
  722. Xmain.o: ../include/config.h
  723. Xmain.o: ../include/list.h
  724. Xmain.o: ../include/tripwire.h
  725. Xmain.o: ../sigs/snefru/snefru.h
  726. Xmain.o: ../sigs/md5/md5.h
  727. Xmain.o: ../sigs/crc32/crc32.h
  728. Xmain.o: ../sigs/crc/crc.h
  729. Xmain.o: ../sigs/md2/md2.h
  730. Xmain.o: ../sigs/md4/md4.h
  731. Xmain.o: ../include/inode.h
  732. Xmain.o: ../include/patchlevel.h
  733. Xnullsig.o: nullsig.c
  734. Xnullsig.o: ../include/config.h
  735. Xnullsig.o: ../include/tripwire.h
  736. Xnullsig.o: ../sigs/snefru/snefru.h
  737. Xnullsig.o: ../sigs/md5/md5.h
  738. Xnullsig.o: ../sigs/crc32/crc32.h
  739. Xnullsig.o: ../sigs/crc/crc.h
  740. Xnullsig.o: ../sigs/md2/md2.h
  741. Xnullsig.o: ../sigs/md4/md4.h
  742. Xnullsig.o: ../include/inode.h
  743. Xnullsig.o: ../include/sigs.h
  744. Xpreen.o: preen.c
  745. Xpreen.o: ../include/config.h
  746. Xpreen.o: ../include/list.h
  747. Xpreen.o: ../include/tripwire.h
  748. Xpreen.o: ../sigs/snefru/snefru.h
  749. Xpreen.o: ../sigs/md5/md5.h
  750. Xpreen.o: ../sigs/crc32/crc32.h
  751. Xpreen.o: ../sigs/crc/crc.h
  752. Xpreen.o: ../sigs/md2/md2.h
  753. Xpreen.o: ../sigs/md4/md4.h
  754. Xpreen.o: ../include/inode.h
  755. Xpreen.interp.o: preen.interp.c
  756. Xpreen.interp.o: ../include/config.h
  757. Xpreen.interp.o: ../include/list.h
  758. Xpreen.interp.o: ../include/tripwire.h
  759. Xpreen.interp.o: ../sigs/snefru/snefru.h
  760. Xpreen.interp.o: ../sigs/md5/md5.h
  761. Xpreen.interp.o: ../sigs/crc32/crc32.h
  762. Xpreen.interp.o: ../sigs/crc/crc.h
  763. Xpreen.interp.o: ../sigs/md2/md2.h
  764. Xpreen.interp.o: ../sigs/md4/md4.h
  765. Xpreen.interp.o: ../include/inode.h
  766. Xpreen.report.o: preen.report.c
  767. Xpreen.report.o: ../include/config.h
  768. Xpreen.report.o: ../include/list.h
  769. Xpreen.report.o: ../include/tripwire.h
  770. Xpreen.report.o: ../sigs/snefru/snefru.h
  771. Xpreen.report.o: ../sigs/md5/md5.h
  772. Xpreen.report.o: ../sigs/crc32/crc32.h
  773. Xpreen.report.o: ../sigs/crc/crc.h
  774. Xpreen.report.o: ../sigs/md2/md2.h
  775. Xpreen.report.o: ../sigs/md4/md4.h
  776. Xpreen.report.o: ../include/inode.h
  777. Xsigfetch.o: sigfetch.c
  778. Xsigfetch.o: ../include/config.h
  779. Xsigfetch.o: ../include/list.h
  780. Xsigfetch.o: ../include/tripwire.h
  781. Xsigfetch.o: ../sigs/snefru/snefru.h
  782. Xsigfetch.o: ../sigs/md5/md5.h
  783. Xsigfetch.o: ../sigs/crc32/crc32.h
  784. Xsigfetch.o: ../sigs/crc/crc.h
  785. Xsigfetch.o: ../sigs/md2/md2.h
  786. Xsigfetch.o: ../sigs/md4/md4.h
  787. Xsigfetch.o: ../include/inode.h
  788. Xutils.o: utils.c
  789. Xutils.o: ../include/config.h
  790. Xutils.o: ../include/list.h
  791. Xutils.o: ../include/tripwire.h
  792. Xutils.o: ../sigs/snefru/snefru.h
  793. Xutils.o: ../sigs/md5/md5.h
  794. Xutils.o: ../sigs/crc32/crc32.h
  795. Xutils.o: ../sigs/crc/crc.h
  796. Xutils.o: ../sigs/md2/md2.h
  797. Xutils.o: ../sigs/md4/md4.h
  798. Xutils.o: ../include/inode.h
  799. END_OF_FILE
  800. if test 7439 -ne `wc -c <'tripwire-1.0/src/Makefile'`; then
  801.     echo shar: \"'tripwire-1.0/src/Makefile'\" unpacked with wrong size!
  802. fi
  803. # end of 'tripwire-1.0/src/Makefile'
  804. fi
  805. if test -f 'tripwire-1.0/sigs/md2/md2.c' -a "${1}" != "-c" ; then 
  806.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/md2/md2.c'\"
  807. else
  808. echo shar: Extracting \"'tripwire-1.0/sigs/md2/md2.c'\" \(7130 characters\)
  809. sed "s/^X//" >'tripwire-1.0/sigs/md2/md2.c' <<'END_OF_FILE'
  810. X#ifndef lint
  811. Xstatic char rcsid[] = "$Id: md2.c,v 1.1.1.2 92/11/02 18:21:23 genek Exp $";
  812. X#endif
  813. X
  814. X/* MD2C.C - RSA Data Security, Inc., MD2 message-digest algorithm
  815. X */
  816. X
  817. X/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
  818. X   rights reserved.
  819. X
  820. X   License to copy and use this software is granted for
  821. X   non-commercial Internet Privacy-Enhanced Mail provided that it is
  822. X   identified as the "RSA Data Security, Inc. MD2 Message Digest
  823. X   Algorithm" in all material mentioning or referencing this software
  824. X   or this function.
  825. X
  826. X   RSA Data Security, Inc. makes no representations concerning either
  827. X   the merchantability of this software or the suitability of this
  828. X   software for any particular purpose. It is provided "as is"
  829. X   without express or implied warranty of any kind.
  830. X
  831. X   These notices must be retained in any copies of any part of this
  832. X   documentation and/or software.
  833. X */
  834. X
  835. X#include "global.h"
  836. X#include "md2.h"
  837. X
  838. Xstatic void MD2Transform PROTO_LIST
  839. X  ((unsigned char [16], unsigned char [16], unsigned char [16]));
  840. Xstatic void MD2_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
  841. Xstatic void MD2_memset PROTO_LIST ((POINTER, int, unsigned int));
  842. X
  843. X/* Permutation of 0..255 constructed from the digits of pi. It gives a
  844. X   "random" nonlinear byte substitution operation.
  845. X */
  846. Xstatic unsigned char PI_SUBST[256] = {
  847. X  41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
  848. X  19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
  849. X  76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
  850. X  138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
  851. X  245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
  852. X  148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
  853. X  39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
  854. X  181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
  855. X  150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
  856. X  112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
  857. X  96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
  858. X  85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
  859. X  234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
  860. X  129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
  861. X  8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
  862. X  203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
  863. X  166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
  864. X  31, 26, 219, 153, 141, 51, 159, 17, 131, 20
  865. X};
  866. X
  867. Xstatic unsigned char *PADDING[] = {
  868. X  (unsigned char *)"",
  869. X  (unsigned char *)"\001",
  870. X  (unsigned char *)"\002\002",
  871. X  (unsigned char *)"\003\003\003",
  872. X  (unsigned char *)"\004\004\004\004",
  873. X  (unsigned char *)"\005\005\005\005\005",
  874. X  (unsigned char *)"\006\006\006\006\006\006",
  875. X  (unsigned char *)"\007\007\007\007\007\007\007",
  876. X  (unsigned char *)"\010\010\010\010\010\010\010\010",
  877. X  (unsigned char *)"\011\011\011\011\011\011\011\011\011",
  878. X  (unsigned char *)"\012\012\012\012\012\012\012\012\012\012",
  879. X  (unsigned char *)"\013\013\013\013\013\013\013\013\013\013\013",
  880. X  (unsigned char *)"\014\014\014\014\014\014\014\014\014\014\014\014",
  881. X  (unsigned char *)
  882. X    "\015\015\015\015\015\015\015\015\015\015\015\015\015",
  883. X  (unsigned char *)
  884. X    "\016\016\016\016\016\016\016\016\016\016\016\016\016\016",
  885. X  (unsigned char *)
  886. X    "\017\017\017\017\017\017\017\017\017\017\017\017\017\017\017",
  887. X  (unsigned char *)
  888. X    "\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020"
  889. X};
  890. X
  891. X/* MD2 initialization. Begins an MD2 operation, writing a new context.
  892. X */
  893. Xvoid MD2Init (context)
  894. XMD2_CTX *context;                                        /* context */
  895. X{
  896. X  context->count = 0;
  897. X  MD2_memset ((POINTER)context->state, 0, sizeof (context->state));
  898. X  MD2_memset
  899. X    ((POINTER)context->checksum, 0, sizeof (context->checksum));
  900. X}
  901. X
  902. X/* MD2 block update operation. Continues an MD2 message-digest
  903. X     operation, processing another message block, and updating the
  904. X     context.
  905. X */
  906. Xvoid MD2Update (context, input, inputLen)
  907. XMD2_CTX *context;                                        /* context */
  908. Xunsigned char *input;                                /* input block */
  909. Xunsigned int inputLen;                     /* length of input block */
  910. X{
  911. X  unsigned int i, index, partLen;
  912. X
  913. X  /* Update number of bytes mod 16 */
  914. X  index = context->count;
  915. X  context->count = (index + inputLen) & 0xf;
  916. X
  917. X  partLen = 16 - index;
  918. X
  919. X  /* Transform as many times as possible.
  920. X    */
  921. X  if (inputLen >= partLen) {
  922. X    MD2_memcpy
  923. X      ((POINTER)&context->buffer[index], (POINTER)input, partLen);
  924. X    MD2Transform (context->state, context->checksum, context->buffer);
  925. X
  926. X    for (i = partLen; i + 15 < inputLen; i += 16)
  927. X      MD2Transform (context->state, context->checksum, &input[i]);
  928. X
  929. X    index = 0;
  930. X  }
  931. X  else
  932. X    i = 0;
  933. X
  934. X  /* Buffer remaining input */
  935. X  MD2_memcpy
  936. X    ((POINTER)&context->buffer[index], (POINTER)&input[i],
  937. X     inputLen-i);
  938. X}
  939. X
  940. X/* MD2 finalization. Ends an MD2 message-digest operation, writing the
  941. X     message digest and zeroizing the context.
  942. X */
  943. Xvoid MD2Final (digest, context)
  944. Xunsigned char digest[16];                         /* message digest */
  945. XMD2_CTX *context;                                        /* context */
  946. X{
  947. X  unsigned int index, padLen;
  948. X
  949. X  /* Pad out to multiple of 16.
  950. X   */
  951. X  index = context->count;
  952. X  padLen = 16 - index;
  953. X  MD2Update (context, PADDING[padLen], padLen);
  954. X
  955. X  /* Extend with checksum */
  956. X  MD2Update (context, context->checksum, 16);
  957. X
  958. X  /* Store state in digest */
  959. X  MD2_memcpy ((POINTER)digest, (POINTER)context->state, 16);
  960. X
  961. X  /* Zeroize sensitive information.
  962. X   */
  963. X  MD2_memset ((POINTER)context, 0, sizeof (*context));
  964. X}
  965. X
  966. X/* MD2 basic transformation. Transforms state and updates checksum
  967. X     based on block.
  968. X */
  969. Xstatic void MD2Transform (state, checksum, block)
  970. Xunsigned char state[16];
  971. Xunsigned char checksum[16];
  972. Xunsigned char block[16];
  973. X{
  974. X  unsigned int i, j, t;
  975. X  unsigned char x[48];
  976. X
  977. X  /* Form encryption block from state, block, state ^ block.
  978. X   */
  979. X  MD2_memcpy ((POINTER)x, (POINTER)state, 16);
  980. X  MD2_memcpy ((POINTER)x+16, (POINTER)block, 16);
  981. X  for (i = 0; i < 16; i++)
  982. X    x[i+32] = state[i] ^ block[i];
  983. X
  984. X  /* Encrypt block (18 rounds).
  985. X   */
  986. X  t = 0;
  987. X  for (i = 0; i < 18; i++) {
  988. X    for (j = 0; j < 48; j++)
  989. X      t = x[j] ^= PI_SUBST[t];
  990. X    t = (t + i) & 0xff;
  991. X  }
  992. X
  993. X  /* Save new state */
  994. X  MD2_memcpy ((POINTER)state, (POINTER)x, 16);
  995. X
  996. X  /* Update checksum.
  997. X   */
  998. X  t = checksum[15];
  999. X  for (i = 0; i < 16; i++)
  1000. X    t = checksum[i] ^= PI_SUBST[block[i] ^ t];
  1001. X
  1002. X  /* Zeroize sensitive information.
  1003. X   */
  1004. X  MD2_memset ((POINTER)x, 0, sizeof (x));
  1005. X}
  1006. X
  1007. X/* Note: Replace "for loop" with standard memcpy if possible.
  1008. X */
  1009. Xstatic void MD2_memcpy (output, input, len)
  1010. XPOINTER output;
  1011. XPOINTER input;
  1012. Xunsigned int len;
  1013. X{
  1014. X  unsigned int i;
  1015. X
  1016. X  for (i = 0; i < len; i++)
  1017. X    output[i] = input[i];
  1018. X}
  1019. X
  1020. X/* Note: Replace "for loop" with standard memset if possible.
  1021. X */
  1022. Xstatic void MD2_memset (output, value, len)
  1023. XPOINTER output;
  1024. Xint value;
  1025. Xunsigned int len;
  1026. X{
  1027. X  unsigned int i;
  1028. X
  1029. X  for (i = 0; i < len; i++)
  1030. X    ((char *)output)[i] = (char)value;
  1031. X}
  1032. END_OF_FILE
  1033. if test 7130 -ne `wc -c <'tripwire-1.0/sigs/md2/md2.c'`; then
  1034.     echo shar: \"'tripwire-1.0/sigs/md2/md2.c'\" unpacked with wrong size!
  1035. fi
  1036. # end of 'tripwire-1.0/sigs/md2/md2.c'
  1037. fi
  1038. if test -f 'tripwire-1.0/Changelog' -a "${1}" != "-c" ; then 
  1039.   echo shar: Will not clobber existing file \"'tripwire-1.0/Changelog'\"
  1040. else
  1041. echo shar: Extracting \"'tripwire-1.0/Changelog'\" \(6891 characters\)
  1042. sed "s/^X//" >'tripwire-1.0/Changelog' <<'END_OF_FILE'
  1043. X# $Id: Changelog,v 1.3 92/11/03 13:34:39 genek Exp $
  1044. X
  1045. XThe following is the official list of changes between revisions:
  1046. X
  1047. Xfirst official release
  1048. X1.0:                     Tue Nov  3 02:35:17 EST 1992
  1049. X    reorganized distribution into heirarchy. 
  1050. X    changed pathnames (./Tests -> ./tests, ./Databases -> ./databases).
  1051. X    tripwire now creates ./databases directory if it doesn't already exist
  1052. X    when -initialize.
  1053. X    finished TODO list.
  1054. X
  1055. Xended beta testing period
  1056. X0.92 beta 6:                 Tue Oct 20 14:55:03 EST 1992
  1057. X    attempting to fix macro recursion problem.  (thanks Shabbir Safdar)
  1058. X    fixed 'make test' variable assignment problem.  (thanks Tom Gutnick)
  1059. X    fixed lstat()/SVR3 problem.  (thanks Simon Leinen)
  1060. X
  1061. X0.92 beta 5:                 Sun Oct 18 19:33:19 EST 1992
  1062. X    integrated substantial source code cleanup patch.
  1063. X    (thanks Ken McDonell)
  1064. X    added types.c to glean struct stat info.
  1065. X    added -i #|all flags, to specify which signatures to skip.
  1066. X    this feature was added to make running Tripwire on an hourly
  1067. X    basis reasonable.  i.e., on hourly runs, check only CRC's.
  1068. X    On daily runs, check md5.  On weekly runs, check all signatures.
  1069. X    (thanks John Rouillard)
  1070. X    fixed usage message, and -D and -U error handling.
  1071. X    added "-initialise" for people who don't speak American.  :-)
  1072. X    (thanks Michael Barnett)
  1073. X    got signature object file dependencies right, finally.
  1074. X
  1075. X0.92 beta 4:                  Fri Oct 16 18:32:36 EST 1992
  1076. X    the day of patch-infamy.
  1077. X    a one-line fix to stop tripwire from saying all filenames are
  1078. X    not absolutely qualified.  *sigh*
  1079. X
  1080. X0.92 beta 3:                 Fri Oct 16 18:02:59 EST 1992
  1081. X    fixed Makefile rule.  (thanks Rich Salz)
  1082. X    fixed duplicate yacc token.  (thanks Rich Salz)
  1083. X    fixed qualified filename bug.  (thanks Ken McDonnel)
  1084. X    removed htonl(), ntohl() routines in utils.c.
  1085. X    added -D, -U flags to do command-line defines and undefines.
  1086. X    (thanks John Rouillard)
  1087. X    added more checks for null lists in list.c.
  1088. X    @@ifdef and @@ifhost support logical expressions:
  1089. X    @@ifdef (x || y && (z1 && (z2))) is now legal in tw.config grammar.
  1090. X    @@ifhost (x || y && (z1 && (z2))) is now legal in tw.config grammar.
  1091. X    added line continuation with '\' in tw.config grammar.
  1092. X    added @@echo for testing.  maybe we'll keep it?
  1093. X    default ignore flags and templates now ignore signatures 3-9.
  1094. X    added [()|&] as characters that need to be escaped in database.
  1095. X    fixed filename_escape_expand().
  1096. X
  1097. X0.92 beta 2:                 Fri Oct 16 12:18:28 EST 1992
  1098. X    finally fixed up '=' pruning.  (thanks David Wiseman)
  1099. X    added Porting database.
  1100. X    added transient file handling in config.parse.c.
  1101. X    fixed comment handling in config.parse.c.
  1102. X    merged gazillions of platform dependencies.  let's hope everything
  1103. X    still works.
  1104. X    reorganized Makefile so it's easier to spot your own platform, I hope.
  1105. X    make Tripwire compiles bearable for systems w/o BSD filesystems.
  1106. X    various semantic and lint cleanups.
  1107. X    reorganized phase 3 presenation.  more verbose, hopefully clearer.
  1108. X    (thanks Christopher Samuel)
  1109. X    added user-contributed tripwire.config files.
  1110. X    purged >14 character filenames:
  1111. X    database.build.c     -> dbase.build.c
  1112. X    tripwire.config        -> tw.config
  1113. X    tripwire.database_@    -> tw.db_@
  1114. X                    ^^-- room for 9-character hostname
  1115. X    added COPS interface in ./contrib.  (thanks Shabbir Safdar)
  1116. X    added "-f dbasefile" option to specify alternate dbase file.
  1117. X    (allows "-f -" to read from stdin.) 
  1118. X    added "-c configfile" option to specify alternate config file
  1119. X    (allows "-c -" to read from stdin.) 
  1120. X    added code to escape filenames starting with '#'.
  1121. X    added tw.config preprocessor directives:
  1122. X    @@ifhost
  1123. X    @@define x VAR
  1124. X    @@undef x
  1125. X    @@ifdef x
  1126. X    @@endif
  1127. X    @@include
  1128. X    ...and 
  1129. X        variable substition (@@x --(turns into)--> VAR)
  1130. X    added "-E" or "-preprocess" to print out processed tw.config
  1131. X    file.  (ala "cc -E" or "cpp".)
  1132. X    added incremental database. (-update entry)
  1133. X    md5 fix for Cray. (thanks John Cristy)
  1134. X    AIX fix for stat structure.  (thanks Shabbir Safdar)
  1135. X    config_interpolate() now caches vectors, instead recomputing every
  1136. X    time.
  1137. X    tripwire now makes backup of files when doing "-update".
  1138. X    played with profiler.  halved the number of calls strlen().  
  1139. X    (I wonder if we can do the same with strcpy().)
  1140. X    made backup file 14-character length friendly for SVR3 people.
  1141. X    so, now tripwire is completely 14-character filename friendly, right?
  1142. X    implemented tw.config parsing routines in lex and yacc
  1143. X    added @@dbaseversion directive to specify what format the tw_db files
  1144. X    use.  this is to prevent reading in unknown database files.
  1145. X    completed filename_escape_expand() to handle all sorts of escape
  1146. X    sequences (escaped octals, cooked-style escaped characters,
  1147. X    and all of tripwire's special characters [e.g., '\@']).
  1148. X    added warning of null characters in filename.
  1149. X    created consistent escaping and de-escaping of characters to and 
  1150. X    from database.
  1151. X    sped up character escaping routines by using all table-lookups.
  1152. X    moved database format strings into the header file.
  1153. X    list generation sped up (1500 files in 20 seconds on Sequent).
  1154. X    added tw.config.5 manual page, which describes the tw.config
  1155. X    syntax and preprocessor directives.
  1156. X    added @@else directive to tw.config parser.
  1157. X    changed signature routines to return number in base-64.
  1158. X    this has the unfortunate effect of making all the signatures look
  1159. X    like pathnames, but it does make signature storage 6 bytes instead
  1160. X    of 8 bytes.
  1161. X    added support for 10 signatures.
  1162. X    fixed tripwire -update.  now skips directory entries when regenerating
  1163. X    database.
  1164. X    added CRC16 and CRC32 to signature routine repository.
  1165. X    added "sigs.h" to make signature routines more general.
  1166. X    added MD2 and MD4.
  1167. X    changed 'make test' so no files are clobbered.
  1168. X    fixed '-d dbasefile' bug.
  1169. X    
  1170. X    
  1171. X
  1172. X0.9beta8:                 Thu Sep 17 19:06:18 EST 1992
  1173. X    eliminated use of 'sort' and 'diff', using list routines instead
  1174. X    (fixed tripwire confusion in parsing '=' additions from diff
  1175. X    which generated zillions of bogus changed file entries.)
  1176. X    this speeds up Phase 3 considerably, since we don't sort!
  1177. X    sped up linked-list/hash routines (HASHSZ increased by 100x)
  1178. X    removed diff.sorted.c
  1179. X    (thanks to the five people who tested this:  David Wiseman, John
  1180. X    Sutton, Lance Bailey, John Rouillard, David Smith).
  1181. X
  1182. X0.9beta7:                 Thu Sep 10 20:45:02 EST 1992
  1183. X    fixed list initialization routine.
  1184. X    fixed Makefile, README, manual page.
  1185. X    fixed memory leak problems (spotted by Purify).
  1186. X    fixed default ignore-masking handling bug.
  1187. X    (didn't convert to internal form first)
  1188. X    fixed ignore-mask parsing.  (David Smith)
  1189. X    added banner to Tripwire databases on creation.
  1190. X    taught tripwire to say what version it is.
  1191. X    sped up most commonly called routines (config_interpolate() and
  1192. X    slash_count()).  Thanks Rich Salz!
  1193. X
  1194. X0.9beta6:                Wed Sep 09 21:04:35 EST 1992
  1195. X    First version of Tripwire to see the light of day.
  1196. X
  1197. END_OF_FILE
  1198. if test 6891 -ne `wc -c <'tripwire-1.0/Changelog'`; then
  1199.     echo shar: \"'tripwire-1.0/Changelog'\" unpacked with wrong size!
  1200. fi
  1201. # end of 'tripwire-1.0/Changelog'
  1202. fi
  1203. if test -f 'tripwire-1.0/Ported' -a "${1}" != "-c" ; then 
  1204.   echo shar: Will not clobber existing file \"'tripwire-1.0/Ported'\"
  1205. else
  1206. echo shar: Extracting \"'tripwire-1.0/Ported'\" \(6820 characters\)
  1207. sed "s/^X//" >'tripwire-1.0/Ported' <<'END_OF_FILE'
  1208. X## $Id: Ported,v 1.2 92/11/03 04:57:24 genek Exp $ 
  1209. X
  1210. X##  Following is an information list of machines to which
  1211. X##  Tripwire has been ported.  This lists the OS environment,
  1212. X##  special flags, skeleton config file, and other info
  1213. X##  to enable you to get up and running.  It is *not* quite
  1214. X##  complete because not every filesystem configuration will
  1215. X##  be represented in this list.
  1216. X##
  1217. X##  Also, we credit (and thank again!) our beta testers who
  1218. X##  provided this information for the release.
  1219. X
  1220. Xvendor:         Apple 
  1221. Xos:             A/UX
  1222. Xos version:     3.x
  1223. Xcompiler:       cc
  1224. Xcflags:         -O
  1225. Xldflags:        
  1226. Xlibs:          
  1227. Xconf.h:         conf-aux3.h
  1228. Xtw.config:
  1229. Xcontributor:    Phillip Porch (root@raidernet.com)
  1230. X
  1231. Xvendor:         Carnegie-Mellon University
  1232. Xos:             Mach
  1233. Xos version:     2.x
  1234. Xcompiler:       cc
  1235. Xcflags:         -O
  1236. Xldflags:        none
  1237. Xlibs:           none
  1238. Xconf.h:         conf-mach.h
  1239. Xtw.config:      not available
  1240. Xcontributor:    Peter Shipley <shipley@tfs.com>
  1241. X
  1242. Xvendor:        Convex
  1243. Xos:        ConvexOS
  1244. Xos version:    9.1
  1245. Xcompiler:    cc
  1246. Xcflags:        -O
  1247. Xldflags:    none
  1248. Xlibs:        none
  1249. Xconf.h:        conf-convex.h
  1250. Xnotes:
  1251. Xcontributor:    Adrian P. van Bloois <adrian@cc.ruu.nl>
  1252. X
  1253. Xvendor:        Cray Research
  1254. Xos:        Unicos
  1255. Xos version:    6.1.6
  1256. Xcompiler:    cc
  1257. Xcflags:        -g
  1258. Xldflags:    none
  1259. Xlibs:        none
  1260. Xconf.h:        conf-unicos.h
  1261. Xnotes:
  1262. Xcontributor:    Michael Barnett <rxxmnb@argolis.osf.rmit.OZ.AU>
  1263. Xcontributor:    cristy@eplrx7.es.duPont.com (John Cristy)
  1264. Xcontributor:    John Sutton <jggs@acl.lanl.gov>
  1265. X
  1266. Xvendor:        DEC
  1267. Xos:        Ultrix 
  1268. Xos version:    4.x
  1269. Xcompiler:    cc
  1270. Xcflags:        -g
  1271. Xldflags:    none
  1272. Xlibs:        none
  1273. Xconf.h:        conf-bsd.h
  1274. Xnotes:
  1275. Xcontributor:    Shabbir Safdar <shabby@mentor.cc.purdue.edu>
  1276. Xcontributor:    John Sutton <jggs@acl.lanl.gov>
  1277. Xcontributor:    Michaela Harlander <harmic@physik.tu-muenchen.de>
  1278. X
  1279. Xvendor:        Encore (Multimax)
  1280. Xos:        Umax
  1281. Xos version:    2.4.1
  1282. Xcompiler:    cc
  1283. Xcflags:        -O
  1284. Xldflags:
  1285. Xlibs:        
  1286. Xconf.h:        conf-umaxv.h
  1287. Xnotes:
  1288. Xcontributor:    Michael Barnett <rxxmnb@argolis.osf.rmit.OZ.AU>
  1289. X
  1290. Xvendor:        FPS
  1291. Xos:        FPX
  1292. Xos version:    4.3.3
  1293. Xcompiler:    cc
  1294. Xcflags:        -g
  1295. Xldflags:    none
  1296. Xlibs:        none
  1297. Xconf.h:        conf-bsd.h
  1298. Xtw.config:    
  1299. Xnotes:        
  1300. Xcontributor:    John Sutton <jggs@acl.lanl.gov>
  1301. X
  1302. Xvendor:        HP
  1303. Xos:        HP/UX
  1304. Xos version:    8.x, 9.x
  1305. Xcompiler:    cc
  1306. Xcflags:        -O -Aa -N        (ansi)
  1307. Xcflags:        -O -Ak -N        (k&r)
  1308. Xcflags:        -O -Wl,-a,archive -O -Ac (ensure archived, NO shared libraries)
  1309. Xldflags:    
  1310. Xlibs:        
  1311. Xconf.h:        conf-hpux.h
  1312. Xnotes:        from Lance Bailey:
  1313. Xnotes:            -Aa                   ansi
  1314. Xnotes:            -Ac                   K&R
  1315. Xnotes:            -Wl,-a,archive        ensure archived and NOT shared libraries on linking
  1316. Xnotes:            -O                    optimizer
  1317. Xnotes:            -g                    debugger
  1318. Xcontributor:    Lance Bailey <lrb@ctrg.rri.uwo.ca>
  1319. Xcontributor:    Joe Polcari <jpolcari@galaxy.prime.com>
  1320. Xcontributor:    Michaela Harlander <harmic@physik.tu-muenchen.de>
  1321. X
  1322. Xvendor:        IBM
  1323. Xos:        AIX
  1324. Xos version:    3.x
  1325. Xcompiler:    cc
  1326. Xcflags:        -g
  1327. Xldflags:    none
  1328. Xlibs:        none
  1329. Xconf.h:        conf-aix.h
  1330. Xcontributor:    Shabbir Safdar <shabby@mentor.cc.purdue.edu>
  1331. Xcontributor:    John Sutton <jggs@acl.lanl.gov>
  1332. X
  1333. Xvendor:         IBM/Intel box
  1334. Xos:             BSDI
  1335. Xos version:     beta
  1336. Xcompiler:       gcc
  1337. Xcflags:         -O
  1338. Xldflags:        none
  1339. Xlibs:           none
  1340. Xconf.h:         conf-bsd.h
  1341. Xtw.config:
  1342. Xnotes:
  1343. Xcontributor:    Michaela Harlander <harmic@physik.tu-muenchen.de>
  1344. X
  1345. Xvendor:        MIPS Computer Systems 
  1346. Xos:        EP/IX
  1347. Xos version:    1.4.3
  1348. Xcompiler:    cc
  1349. Xcflags:        -O -systype sysv -I/usr/include/bsd -I/usr/include/sysv
  1350. Xldflags:    none
  1351. Xlibs:        -lbsd
  1352. Xconf.h:        conf-epix.h
  1353. Xtw.config:    (Gosh, I haven't submitted one yet)
  1354. Xnotes:        
  1355. Xcontributor:    Shabbir J. Safdar <shabby@cc.purdue.edu>
  1356. Xcontributor:    Michaela Harlander <harmic@physik.tu-muenchen.de>
  1357. X
  1358. Xvendor:        NeXT 
  1359. Xos:        Mach (NeXTstep)
  1360. Xos version:    2.x, 3.x
  1361. Xcompiler:    cc
  1362. Xcflags:        -O (2.x), -O2 (3.0)
  1363. Xldflags:    -Bstatic
  1364. Xlibs:        none
  1365. Xconf.h:        conf-mach.h
  1366. Xtw.config:    (Gosh, I haven't submitted one yet)
  1367. Xnotes:        
  1368. Xcontributor:    Joe Polcari <jpolcari@galaxy.prime.com>
  1369. X
  1370. Xvendor:        OSF
  1371. Xos:        OSF/1
  1372. Xos version:    1.0.4
  1373. Xcompiler:    cc
  1374. Xcflags:        -O
  1375. Xlibs:        -lsun -lc_s
  1376. Xldflags:    -non_shared
  1377. Xconf.h:        conf-osf1.h
  1378. Xnotes:
  1379. Xcontributor:    Dean Brock <brock@cs.unca.edu>
  1380. X
  1381. Xvendor:        OSF
  1382. Xos:        OSF/1
  1383. Xos version:    1.0.4
  1384. Xcompiler:    gcc
  1385. Xcflags:        -O -g
  1386. Xlibs:    
  1387. Xldflags:
  1388. Xconf.h:        conf-osf1.h
  1389. Xnotes:
  1390. Xcontributor:    Rich Salz <rsalz@osf.org>
  1391. X
  1392. Xvendor:         Pyramid
  1393. Xos:             DC/OSx (SVR4)
  1394. Xos version:     1.1 [all releases]
  1395. Xcompiler:       cc
  1396. Xcflags:         -O -Kold
  1397. Xldflags:        -dn
  1398. Xlibs:           none
  1399. Xconf.h:         conf-svr4.h
  1400. Xtw.config:      
  1401. Xcontributor:    Ken McDonell <kenj@pyramid.com>
  1402. X
  1403. Xvendor:         Pyramid
  1404. Xos:             DC/OSx (att universe)
  1405. Xos version:     5.1 [all releases]
  1406. Xcompiler:       cc
  1407. Xcflags:         -OG
  1408. Xldflags:        none
  1409. Xlibs:           none
  1410. Xconf.h:         conf-osx-att.h
  1411. Xtw.config:      
  1412. Xcontributor:    Ken McDonell <kenj@pyramid.com>
  1413. X
  1414. Xvendor:         Pyramid
  1415. Xos:             DC/OSx (ucb universe)
  1416. Xos version:     5.1 [all releases]
  1417. Xcompiler:       cc
  1418. Xcflags:         -OG
  1419. Xldflags:        none
  1420. Xlibs:           none
  1421. Xconf.h:         conf-osx-ucb.h
  1422. Xtw.config:      
  1423. Xcontributor:    Ken McDonell <kenj@pyramid.com>
  1424. X
  1425. Xvendor:        Sequent
  1426. Xos:        Dynix
  1427. Xos version:    3.x
  1428. Xcompiler:    cc
  1429. Xcflags:        -O
  1430. Xldflags:
  1431. Xlibs:        
  1432. Xconf.h:        conf-dynix.h
  1433. Xnotes:
  1434. Xcontributor:    Gene Kim <genek@mentor.cc.purdue.edu>
  1435. X
  1436. Xvendor:         Sun
  1437. Xos:             SunOS
  1438. Xos version:     4.0.3
  1439. Xcompiler:       gcc, cc
  1440. Xcflags:         -O
  1441. Xldflags:        -Bstatic
  1442. Xlibs:           none
  1443. Xconf.h:         conf-bsd.h
  1444. Xtw.config:      I have submitted one
  1445. Xnotes:        if you run ARM/ASET, see ./contrib/README.ASET
  1446. Xcontributor:    Joe Polcari <jpolcari@galaxy.prime.com>
  1447. Xcontributor:    John Sutton <jggs@acl.lanl.gov>
  1448. Xcontributor:    Brad Powell <Brad.Powell@Corp.Sun.COM>
  1449. X
  1450. Xvendor:        Sun Microsystems, Inc.
  1451. Xos:        SunOS 
  1452. Xos version:    5.x (Solaris 2.x)
  1453. Xcompiler:    cc
  1454. Xcflags:        -O
  1455. Xldflags:
  1456. Xlibs:        
  1457. Xconf.h:        conf-svr4.h
  1458. Xnotes:
  1459. Xcontributor:    Brad Powell <Brad.Powell@Corp.Sun.COM>
  1460. Xcontributor:    Michaela Harlander <harmic@physik.tu-muenchen.de>
  1461. X
  1462. Xvendor:        SCO, Tandy
  1463. Xos:        Xenix
  1464. Xos version:    03.02.00, 2.2.4
  1465. Xcompiler:    cc
  1466. Xcflags:        
  1467. Xldflags:
  1468. Xlibs:        -lx
  1469. Xconf.h:        conf-xenix.h
  1470. Xnotes:
  1471. Xcontributor:    Daniel Ray <norstar@tnl.com>
  1472. X
  1473. X
  1474. Xvendor:         Santa Cruz Operation
  1475. Xos:             XENIX System V 386
  1476. Xos version:     2.2.6
  1477. Xcompiler:       Microsoft C 5.1
  1478. Xcflags:         -O
  1479. Xldflags:        -s -lx
  1480. Xlibs:           none
  1481. Xconf.h:         conf-sysv4.h  [modified for xenix to support MAXNAMLEN]
  1482. Xtw.config: 
  1483. Xnotes:          see all my email to you
  1484. Xcontributor:    Daniel Ray <norstar@tnl.com>
  1485. X
  1486. Xvendor:        SGI
  1487. Xos:        IRIX
  1488. Xos version:    4.x
  1489. Xcompiler:    cc
  1490. Xcflags:        -O -cckr
  1491. Xlibs:        none
  1492. Xldflags:    none
  1493. Xconf.h:        conf-svr4.h
  1494. Xnotes:
  1495. Xcontributor:    Bill Henderson <billh@bike.hampton.sgi.com>
  1496. Xcontributor:    John G. Sutton <jggs@acl.lanl.gov>
  1497. X
  1498. Xvendor:        SGI
  1499. Xos:        IRIX
  1500. Xos version:    4.0.5
  1501. Xcompiler:    cc
  1502. Xcflags:    
  1503. Xldflags:
  1504. Xlibs:        -lsun -lc_s
  1505. Xconf.h:        conf-irix4.h
  1506. Xnotes:
  1507. Xcontributor:    Simon Leinen <simon@lia.di.epfl.ch>
  1508. END_OF_FILE
  1509. if test 6820 -ne `wc -c <'tripwire-1.0/Ported'`; then
  1510.     echo shar: \"'tripwire-1.0/Ported'\" unpacked with wrong size!
  1511. fi
  1512. # end of 'tripwire-1.0/Ported'
  1513. fi
  1514. if test -f 'tripwire-1.0/sigs/crc/crc.c' -a "${1}" != "-c" ; then 
  1515.   echo shar: Will not clobber existing file \"'tripwire-1.0/sigs/crc/crc.c'\"
  1516. else
  1517. echo shar: Extracting \"'tripwire-1.0/sigs/crc/crc.c'\" \(6511 characters\)
  1518. sed "s/^X//" >'tripwire-1.0/sigs/crc/crc.c' <<'END_OF_FILE'
  1519. X#ifndef lint
  1520. Xstatic char rcsid[] = "$Id: crc.c,v 1.1.1.2 92/11/02 18:20:37 genek Exp $";
  1521. X#endif
  1522. X
  1523. X/*
  1524. X * crc.c
  1525. X *
  1526. X *    signature function hook for CRC-16.
  1527. X *
  1528. X * Gene Kim
  1529. X * Purdue University
  1530. X * October 14, 1992
  1531. X */
  1532. X
  1533. X  /* ============================================================= */
  1534. X  /*  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or       */
  1535. X  /*  code or tables extracted from it, as desired without restriction.     */
  1536. X  /*                                                                        */
  1537. X  /*  First, the polynomial itself and its table of feedback terms.  The    */
  1538. X  /*  polynomial is                                                         */
  1539. X  /*  X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0   */
  1540. X  /*                                                                        */
  1541. X  /*  Note that we take it "backwards" and put the highest-order term in    */
  1542. X  /*  the lowest-order bit.  The X^32 term is "implied"; the LSB is the     */
  1543. X  /*  X^31 term, etc.  The X^0 term (usually shown as "+1") results in      */
  1544. X  /*  the MSB being 1.                                                      */
  1545. X  /*                                                                        */
  1546. X  /*  Note that the usual hardware shift register implementation, which     */
  1547. X  /*  is what we're using (we're merely optimizing it by doing eight-bit    */
  1548. X  /*  chunks at a time) shifts bits into the lowest-order term.  In our     */
  1549. X  /*  implementation, that means shifting towards the right.  Why do we     */
  1550. X  /*  do it this way?  Because the calculated CRC must be transmitted in    */
  1551. X  /*  order from highest-order term to lowest-order term.  UARTs transmit   */
  1552. X  /*  characters in order from LSB to MSB.  By storing the CRC this way,    */
  1553. X  /*  we hand it to the UART in the order low-byte to high-byte; the UART   */
  1554. X  /*  sends each low-bit to hight-bit; and the result is transmission bit   */
  1555. X  /*  by bit from highest- to lowest-order term without requiring any bit   */
  1556. X  /*  shuffling on our part.  Reception works similarly.                    */
  1557. X  /*                                                                        */
  1558. X  /*  The feedback terms table consists of 256, 32-bit entries.  Notes:     */
  1559. X  /*                                                                        */
  1560. X  /*      The table can be generated at runtime if desired; code to do so   */
  1561. X  /*      is shown later.  It might not be obvious, but the feedback        */
  1562. X  /*      terms simply represent the results of eight shift/xor opera-      */
  1563. X  /*      tions for all combinations of data and CRC register values.       */
  1564. X  /*                                                                        */
  1565. X  /*      The values must be right-shifted by eight bits by the "updcrc"    */
  1566. X  /*      logic; the shift must be unsigned (bring in zeroes).  On some     */
  1567. X  /*      hardware you could probably optimize the shift in assembler by    */
  1568. X  /*      using byte-swap instructions.                                     */
  1569. X  /*      polynomial $edb88320                                              */
  1570. X  /*                                                                        */
  1571. X  /*  --------------------------------------------------------------------  */
  1572. X
  1573. X#include "../../include/config.h"
  1574. X#include <stdio.h>
  1575. X#include <sys/types.h>
  1576. X#ifdef STDLIBH
  1577. X#include <stdlib.h>
  1578. X#include <unistd.h>
  1579. X#endif
  1580. X#include "../../include/sigs.h"
  1581. X#define BUFSIZE 4096
  1582. X
  1583. Xstatic unsigned int crc16;
  1584. X
  1585. Xstatic unsigned int crc16tab[256] =
  1586. X{
  1587. X
  1588. X
  1589. X 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
  1590. X 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
  1591. X 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
  1592. X 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
  1593. X 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
  1594. X 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
  1595. X 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
  1596. X 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
  1597. X 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
  1598. X 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
  1599. X 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
  1600. X 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
  1601. X 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
  1602. X 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
  1603. X 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
  1604. X 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
  1605. X 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
  1606. X 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
  1607. X 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
  1608. X 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
  1609. X 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
  1610. X 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
  1611. X 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
  1612. X 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
  1613. X 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
  1614. X 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
  1615. X 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
  1616. X 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
  1617. X 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
  1618. X 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
  1619. X 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
  1620. X 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
  1621. X};
  1622. X
  1623. Xstatic void
  1624. XUpdateCRC16(buffer, bufsize) 
  1625. X    unsigned char *buffer;
  1626. X    int bufsize;
  1627. X{
  1628. X    register unsigned int i, tmp;
  1629. X
  1630. X    for (i = 0; i < bufsize; i++) {
  1631. X    tmp = crc16 ^ buffer[i];
  1632. X    crc16 = (crc16 >> 8) ^ crc16tab[tmp & 0xff];
  1633. X    /*
  1634. X    crc16 = (crc16 >> 8) ^ crc16tab[((crc16 ^ buffer[i]) & 0xff)];
  1635. X    */
  1636. X    }
  1637. X}
  1638. X
  1639. Xsig_crc_get(fd_in, ps_signature, siglen)
  1640. X    int fd_in;
  1641. X    char *ps_signature;
  1642. X    int siglen;
  1643. X{
  1644. X    unsigned char buffer[BUFSIZE];
  1645. X    int        readin = -1;
  1646. X    int scratch[100];
  1647. X
  1648. X    if (lseek(fd_in, 0, SEEK_SET) < 0) {
  1649. X    perror("sig_crc_get: lseek()");
  1650. X    exit(1);
  1651. X    }
  1652. X
  1653. X
  1654. X    crc16 = 0;
  1655. X    while ((readin = read(fd_in, (char *)buffer, (off_t) BUFSIZE)) == BUFSIZE) {
  1656. X    UpdateCRC16(buffer, BUFSIZE);
  1657. X    }
  1658. X    if (readin != 0) {
  1659. X    UpdateCRC16(buffer, readin);
  1660. X    }
  1661. X    sprintf(ps_signature, "%s", ltob64((unsigned long)(crc16 & 0xFFFF), (char *)scratch));
  1662. X
  1663. X    return 0;
  1664. X}
  1665. X
  1666. END_OF_FILE
  1667. if test 6511 -ne `wc -c <'tripwire-1.0/sigs/crc/crc.c'`; then
  1668.     echo shar: \"'tripwire-1.0/sigs/crc/crc.c'\" unpacked with wrong size!
  1669. fi
  1670. # end of 'tripwire-1.0/sigs/crc/crc.c'
  1671. fi
  1672. if test -f 'tripwire-1.0/configs/tw.conf.hp2' -a "${1}" != "-c" ; then 
  1673.   echo shar: Will not clobber existing file \"'tripwire-1.0/configs/tw.conf.hp2'\"
  1674. else
  1675. echo shar: Extracting \"'tripwire-1.0/configs/tw.conf.hp2'\" \(5418 characters\)
  1676. sed "s/^X//" >'tripwire-1.0/configs/tw.conf.hp2' <<'END_OF_FILE'
  1677. X#
  1678. X# tripwire.config
  1679. X# Generic version for HP/UX
  1680. X#    
  1681. X#    Joe Polcari <jpolcari@galaxy.prime.com>
  1682. X#
  1683. X# This file contains a list of files and directories that System 
  1684. X# Preener will scan.  Information collected from these files will be 
  1685. X# stored in the tripwire.database file.
  1686. X#
  1687. X# Format:             [!|=] entry [ignore-flags]
  1688. X#
  1689. X# where:     '!' signifies the entry is to be pruned (inclusive) from
  1690. X#                the list of files to be scanned.
  1691. X#         '=' signifies the entry is to be added, but if it is
  1692. X#                a directory, then all its contents are pruned
  1693. X#                (useful for /tmp).
  1694. X#
  1695. X# where:    entry is the absolute pathname of a file or a directory
  1696. X#
  1697. X# where ignore-flags are in the format:
  1698. X#        [template][ [+|-][pinugsam12] ... ]
  1699. X#
  1700. X#     - :  ignore the following atributes
  1701. X#    + :  do not ignore the following attributes
  1702. X#
  1703. X#    p :  permission and file mode bits     a: access timestamp
  1704. X#    i :  inode number            m: modification timestamp
  1705. X#    n :  number of links (ref count)    c: inode creation timestamp
  1706. X#    u :  user id of owner            1: signature 1
  1707. X#    g :  group id of owner            2: signature 2
  1708. X#    s :  size of file
  1709. X#
  1710. X#
  1711. X# Ex:   The following entry will scan all the files in /etc, and report
  1712. X#    any changes in mode bits, inode number, reference count, uid,
  1713. X#    gid, modification and creation timestamp, and the signatures.
  1714. X#    However, it will ignore any changes in the access timestamp.
  1715. X#
  1716. X#    /etc    +pinugsm12-a
  1717. X#
  1718. X# The following templates have been pre-defined to make these long ignore
  1719. X# mask descriptions unecessary.
  1720. X#
  1721. X# Templates:     (default)    R :  [R]ead-only (+pinugsm12-a)
  1722. X#                L :  [L]og file (+pinug-sam12)
  1723. X#                N :  ignore [N]othing (+pinusgsamc12)
  1724. X#                E :  ignore [E]verything (-pinusgsamc12)
  1725. X#
  1726. X# By default, Tripwire uses the R template -- it ignores
  1727. X# only the access timestamp.
  1728. X#
  1729. X# You can use templates with modifiers, like:
  1730. X#    Ex:  /etc/lp    E+ug
  1731. X#
  1732. X#    Example configuration file:
  1733. X#        /etc        R    # all system files
  1734. X#        !/etc/lp    R    # ...but not those logs
  1735. X#        =/tmp        N    # just the directory, not its files
  1736. X#
  1737. X# Note the difference between pruning (via "!") and ignoring everything
  1738. X# (via "E" template):  Ignoring everything in a directory still monitors
  1739. X# for added and deleted files.  Pruning a directory will prevent Tripwire
  1740. X# from even looking in the specified directory.
  1741. X#
  1742. X#
  1743. X# Tripwire running slowly?  Modify your tripwire.config entries to
  1744. X# ignore the (signature 2) attribute when this computationally-exorbitant 
  1745. X# protection is not needed.  (See README and design document for further
  1746. X# details.)
  1747. X#
  1748. X#  First, root's "home"
  1749. X=/        L
  1750. X/.rhosts    R    # may not exist
  1751. X/.profile    R    # may not exist
  1752. X/.cshrc        R    # may not exist
  1753. X/.login        R    # may not exist
  1754. X#/.exrc        R    # may not exist
  1755. X/.logout    R    # may not exist
  1756. X#/.emacs        R    # may not exist
  1757. X/.forward    R    # may not exist
  1758. X#/.netrc        R    # may not exist
  1759. X/.defaults    R
  1760. X/.suntools    R
  1761. X/.mailrc    R
  1762. X/.kermrc    R
  1763. X/.newsrc    R
  1764. X
  1765. X# Unix itself
  1766. X/vmunix        R
  1767. X
  1768. X# Now, some critical directories and files
  1769. X#  Some exceptions are noted further down
  1770. X/etc        R
  1771. X/etc/inetd.conf    R
  1772. X/etc/rc        R
  1773. X/etc/rc.boot    R
  1774. X/etc/rc.local    R-2
  1775. X/etc/rc.single    R
  1776. X#/etc/rc.ip    R
  1777. X/etc/ttytab    R
  1778. X/etc/exports    R
  1779. X/etc/ttys    L
  1780. X/etc/dumpdates    L
  1781. X/etc/mtab    L
  1782. X/etc/motd    L
  1783. X/etc/rmtab    L
  1784. X/etc/utmp    L
  1785. X/etc/group    R    # changes should be infrequent
  1786. X#  The next line may need to be replaced with /etc/security
  1787. X#   if C2 is enabled
  1788. X/etc/passwd    L
  1789. X
  1790. X/var        L
  1791. X
  1792. X/dev        E
  1793. X
  1794. X/usr/etc    R
  1795. X
  1796. X# Checksumming the following is not so critical.  However,
  1797. X#  setuid/setgid files are special-cased further down.
  1798. X
  1799. X/lib        R-2
  1800. X
  1801. X/bin        R-2
  1802. X
  1803. X/usr/bin    R-2
  1804. X
  1805. X/usr/ucb    R-2
  1806. X
  1807. X/usr/lib    R-2
  1808. X
  1809. X/usr1/local    R-2
  1810. X
  1811. X/usr2/pics    E
  1812. X
  1813. X=/usr        L
  1814. X=/usr/spool    L
  1815. X/usr/spool/cron        L
  1816. X/usr/spool/mqueue    L
  1817. X/usr/spool/mail        L
  1818. X
  1819. X# You may or may not have the following
  1820. X#/usr/ftp    L
  1821. X#/usr/ftp/bin    R
  1822. X#/usr/ftp/etc    R
  1823. X
  1824. X# put entries in for /var/yp if you need it
  1825. X# put entries for uucp if you need them
  1826. X# put entries for /var/adm if you need it
  1827. X
  1828. X=/tmp
  1829. X=/var/tmp
  1830. X
  1831. X#  Here are entries for setuid/setgid files.  On these, we use
  1832. X#  both signatures just to be sure.
  1833. X#
  1834. X#  You may want/need to edit this list.  Batteries not inc.
  1835. X
  1836. X/admin            N
  1837. X/bin/at            R
  1838. X/bin/atq        R
  1839. X/bin/atrm        R
  1840. X#/bin/cancel        R
  1841. X/bin/chfn        R
  1842. X/bin/chsh        R
  1843. X/bin/crontab        R
  1844. X/bin/cu            R
  1845. X/bin/df            R
  1846. X/bin/iostat        R
  1847. X/bin/ipcs        R
  1848. X/bin/login        R
  1849. X#/bin/lpstat        R
  1850. X/bin/mail        R
  1851. X/bin/newgrp        R
  1852. X/bin/passwd        R
  1853. X/bin/su            R
  1854. X#/bin/sunview1/sv_acquire        R
  1855. X#/bin/sunview1/sv_release        R
  1856. X#/bin/sunview1/toolplaces        R
  1857. X/bin/tip        R
  1858. X/bin/uucp        R
  1859. X/bin/uuname        R
  1860. X/bin/uustat        R
  1861. X/bin/uux        R
  1862. X/bin/wall        R
  1863. X/bin/write        R
  1864. X#/bin/ypchfn        R
  1865. X#/bin/ypchsh        R
  1866. X/bin/yppasswd        R
  1867. X/usr/bin/at        R
  1868. X/usr/bin/atq        R
  1869. X/usr/bin/atrm        R
  1870. X#/usr/bin/cancel        R
  1871. X/usr/bin/chfn        R
  1872. X/usr/bin/chsh        R
  1873. X/usr/bin/crontab    R
  1874. X/usr/bin/cu        R
  1875. X/usr/bin/df        R
  1876. X/usr/bin/iostat        R
  1877. X/usr/bin/ipcs        R
  1878. X/usr/bin/login        R
  1879. X#/usr/bin/lpstat        R
  1880. X/usr/bin/mail        R
  1881. X/usr/bin/newgrp        R
  1882. X/usr/bin/passwd        R
  1883. X/usr/bin/su        R
  1884. X#/usr/bin/sunview1/sv_acquire        R
  1885. X#/usr/bin/sunview1/sv_release        R
  1886. X#/usr/bin/sunview1/toolplaces        R
  1887. X/usr/bin/tip        R
  1888. X/usr/bin/uucp        R
  1889. X/usr/bin/uuname        R
  1890. X/usr/bin/uustat        R
  1891. X/usr/bin/uux        R
  1892. X/usr/bin/wall        R
  1893. X/usr/bin/write        R
  1894. X#/usr/bin/ypchfn        R
  1895. X#/usr/bin/ypchsh        R
  1896. X/usr/bin/yppasswd    R
  1897. X/usr/etc/arp        R
  1898. X#/usr/etc/chill        R
  1899. X#/usr/etc/devinfo    R
  1900. X/usr/etc/dkinfo        R
  1901. X/usr/etc/dmesg        R
  1902. X/usr/etc/dump        R
  1903. X/usr/etc/dumpfs        R
  1904. X/usr/etc/keyenvoy    R
  1905. X/usr/etc/kgmon        R
  1906. X/usr/etc/lpc        R
  1907. X/usr/etc/nfsstat    R
  1908. X/usr/etc/ping        R
  1909. X/usr/etc/rpc.rwalld    R
  1910. X/usr/etc/trpt        R
  1911. X/usr/ucb/lpq        R
  1912. X/usr/ucb/lpr        R
  1913. X/usr/ucb/netstat    R
  1914. X/usr/ucb/rcp        R
  1915. X/usr/ucb/rdist        R
  1916. X/usr/ucb/rlogin        R
  1917. X/usr/ucb/rsh        R
  1918. X/usr/ucb/talk        R
  1919. X/usr/ucb/vmstat        R
  1920. END_OF_FILE
  1921. if test 5418 -ne `wc -c <'tripwire-1.0/configs/tw.conf.hp2'`; then
  1922.     echo shar: \"'tripwire-1.0/configs/tw.conf.hp2'\" unpacked with wrong size!
  1923. fi
  1924. # end of 'tripwire-1.0/configs/tw.conf.hp2'
  1925. fi
  1926. if test -f 'tripwire-1.0/include/config.h' -a "${1}" != "-c" ; then 
  1927.   echo shar: Will not clobber existing file \"'tripwire-1.0/include/config.h'\"
  1928. else
  1929. echo shar: Extracting \"'tripwire-1.0/include/config.h'\" \(4699 characters\)
  1930. sed "s/^X//" >'tripwire-1.0/include/config.h' <<'END_OF_FILE'
  1931. X/* $Id: config.h,v 1.3 92/11/03 02:47:02 genek Exp $ */
  1932. X
  1933. X/*
  1934. X * config.h
  1935. X *
  1936. X *    Tripwire configuration file
  1937. X *
  1938. X * Gene Kim
  1939. X * Purdue University
  1940. X */
  1941. X
  1942. X
  1943. X/***
  1944. X *** Operating System specifics
  1945. X ***    
  1946. X ***    Look in the .,/configs directory, and include appropriate header
  1947. X ***    file that corresponds with your operating system.
  1948. X ***/
  1949. X
  1950. X#include "../configs/conf-dynix.h"
  1951. X
  1952. X
  1953. X/***
  1954. X *** SYSTEM SPECIFIC Tripwire Configuration
  1955. X ***/
  1956. X
  1957. X/******* signature functions *****************************************
  1958. X *
  1959. X * Choose among these:
  1960. X *
  1961. X *    sig_md5_get        : MD5 function
  1962. X *                  (the RSA Data Security, Inc. MD5 Message-
  1963. X *                   Digesting Algorithm)
  1964. X *    sig_snefru_get        : Snefru function
  1965. X *                  (the Xerox Secure Hash Function)
  1966. X *    sig_null_get        : null function (returns 0 for all)
  1967. X *
  1968. X *  By default, Tripwire uses
  1969. X *        int (pf_signature0)() = sig_null_get;
  1970. X *        int (pf_signature1)() = sig_md5_get;
  1971. X *        int (pf_signature2)() = sig_snefru_get;
  1972. X *
  1973. X *  However, since Snefru is comparatively computationally expensive, you
  1974. X *  might consider using only MD5.  This can be done in the configuration,
  1975. X *  however, and should not be done by defining away the signature here.
  1976. X *
  1977. X *  You can replace one of the signature algorithms with another of your
  1978. X *  own choice by adding it to the build procedure, and putting it in
  1979. X *  here in place of one of these standard routines.  See the design
  1980. X *  document for hints on this.
  1981. X *
  1982. X *  To do this, just set one of the signature function pointers to
  1983. X *  your own function.
  1984. X *
  1985. X *********************************************************************/
  1986. X
  1987. X#define SIG0FUNC    sig_null_get
  1988. X#define SIG1FUNC    sig_md5_get
  1989. X#define SIG2FUNC    sig_snefru_get
  1990. X#define SIG3FUNC    sig_crc32_get
  1991. X#define SIG4FUNC    sig_crc_get
  1992. X#define SIG5FUNC    sig_md4_get
  1993. X#define SIG6FUNC    sig_md2_get
  1994. X#define SIG7FUNC    sig_null_get
  1995. X#define SIG8FUNC    sig_null_get
  1996. X#define SIG9FUNC    sig_null_get
  1997. X
  1998. X#define SIG0NAME    "nullsig"
  1999. X#define SIG1NAME    "md5"
  2000. X#define SIG2NAME    "snefru"
  2001. X#define SIG3NAME    "crc32"
  2002. X#define SIG4NAME    "crc16"
  2003. X#define SIG5NAME    "md4"
  2004. X#define SIG6NAME    "md2"
  2005. X#define SIG7NAME    "nullsig"
  2006. X#define SIG8NAME    "nullsig"
  2007. X#define SIG9NAME    "nullsig"
  2008. X
  2009. X/******* path to Tripwire files **************************************
  2010. X *
  2011. X *    Ideally, CONFIG_PATH and DATABASE_PATH should be pointing to
  2012. X *    some read-only media, or some filesystem mounted remotely
  2013. X *    from a "secure-server".  (See design document for details.)
  2014. X *
  2015. X *    Note:  No trailing '/' in the paths!
  2016. X *
  2017. X *********************************************************************/
  2018. X
  2019. X/*
  2020. X#if !defined(SYSV) || (defined(SYSV) && (SYSV > 2))
  2021. X# define CONFIG_PATH     "/usr/adm/tcheck"
  2022. X# define DATABASE_PATH   "/usr/adm/tcheck/databases"
  2023. X#else
  2024. X# define CONFIG_PATH     "/usr/local/adm/tcheck"
  2025. X# define DATABASE_PATH   "/usr/local/adm/tcheck/databases"
  2026. X#endif
  2027. X*/
  2028. X
  2029. X#define CONFIG_PATH     "/tmp/genek"
  2030. X#define DATABASE_PATH   "/tmp/genek"
  2031. X
  2032. X/******* name of Tripwire files **************************************
  2033. X *
  2034. X *    Static filenames are nice, but we allow run-time binding to
  2035. X *    support multiple hosts sharing the same directory (without
  2036. X *    having to recompile.
  2037. X *
  2038. X *    Use the '@' character to represent the hostname of the machine
  2039. X *    running Tripwire.
  2040. X *
  2041. X *    For example "tripwire.database_@" would expand to:
  2042. X *        
  2043. X *        tripwire.database-mentor.cc.purdue.edu
  2044. X *
  2045. X *********************************************************************/
  2046. X
  2047. X#define CONFIG_FILE     "tw.config"
  2048. X#define DATABASE_FILE    "tw.db_@"
  2049. X
  2050. X/******* Default ignore mask ****************************************
  2051. X *
  2052. X *    Usually, the only thing you want to ignore is the access time
  2053. X *    stamp.  But there may be applications where you want to know
  2054. X *    about any accesses, too.
  2055. X *
  2056. X *    Similarly, there may be some environments where you can have a much
  2057. X *     more forgiving ignore mask.
  2058. X *
  2059. X *    By default, Tripwire uses:
  2060. X *        "R" --  read-only files, where only the access time
  2061. X *            stamp can change.
  2062. X *      Alternatively, you might want to make the default be "R-2"
  2063. X *      This would be faster than simply "R", at some small loss
  2064. X *    (perhaps) of protection.
  2065. X *
  2066. X *********************************************************************/
  2067. X
  2068. X#define DEFAULTIGNORE    "R-3456789"
  2069. X
  2070. X/******* Temporary file template ************************************
  2071. X *
  2072. X *    Usually, temporary files are stored in /tmp.  You may want
  2073. X *    to use a different directory if your system does not support
  2074. X *    the BSD "sticky" bit on directories.  (i.e., only owner or root
  2075. X *    can rename or delete files.)
  2076. X *
  2077. X *    Make sure that there are at least 6 X's in the template.
  2078. X *    Each consecutive X signifies a number that mktemp() can
  2079. X *    fill in with a random number.
  2080. X *
  2081. X *********************************************************************/
  2082. X
  2083. X#define TEMPFILE_TEMPLATE "/tmp/twzXXXXXX"
  2084. X
  2085. X
  2086. X
  2087. END_OF_FILE
  2088. if test 4699 -ne `wc -c <'tripwire-1.0/include/config.h'`; then
  2089.     echo shar: \"'tripwire-1.0/include/config.h'\" unpacked with wrong size!
  2090. fi
  2091. # end of 'tripwire-1.0/include/config.h'
  2092. fi
  2093. echo shar: End of archive 6 \(of 8\).
  2094. cp /dev/null ark6isdone
  2095. MISSING=""
  2096. for I in 1 2 3 4 5 6 7 8 ; do
  2097.     if test ! -f ark${I}isdone ; then
  2098.     MISSING="${MISSING} ${I}"
  2099.     fi
  2100. done
  2101. if test "${MISSING}" = "" ; then
  2102.     echo You have unpacked all 8 archives.
  2103.     echo "Now read the README file"
  2104.     rm -f ark[1-9]isdone
  2105. else
  2106.     echo You still need to unpack the following archives:
  2107.     echo "        " ${MISSING}
  2108. fi
  2109. ##  End of shell archive.
  2110. exit 0
  2111. -- 
  2112. Gene Spafford
  2113. Software Engineering Research Center & Dept. of Computer Sciences
  2114. Purdue University, W. Lafayette IN 47907-1398
  2115. Internet:  spaf@cs.purdue.edu    phone:  (317) 494-7825
  2116.