head 1.3; access; symbols trunk-20040613:1.3 mach64-last-merge:1.3 driinterface-0-0-3-20040303-merge:1.3 driinterface-0-0-3-20040303-premerge:1.3 driinterface-0-0-3-20040303:1.3 driinterface-0-0-3-branch:1.3.0.14 mach64-0-0-7-branch:1.3.0.12 driinterface-0-0-2-branch:1.3.0.10 newmesa-0-0-1-20031209-merge:1.3 trunk-20031209:1.3 newmesa-0-0-1-20031209:1.3 newmesa-0-0-1-branch:1.3.0.8 driinterface-0-0-1-branch:1.3.0.6 savage-2-0-0-branch:1.3.0.4 savage-2-0-0-fork:1.3 cle266-0-0-1-branch:1.3.0.2 trunk-20030916:1.3 XFree86-4_3_99_12-merge:1.3 X_4_1_99_1-20010822-merge:1.1.1.6 X_4_1_99_1:1.1.1.6 X_4_1_99_1-20010822-preimport:1.1.1.5 multihead-1-0-0-20010730:1.1.1.5 multihead-1-0-0-20010730-merge:1.1.1.5 multihead-1-0-0-20010727-freeze:1.1.1.5 X_4_1_0-20010615-merge:1.1.1.5 mesa-3-5-20010621-freeze:1.1.1.4.6.1 X_4_1_0:1.1.1.5 X_4_1_0-20010614-preimport:1.1.1.5 multihead-1-0-0-branch:1.1.1.5.0.6 X_4_0_99_3-20010502-merge:1.1.1.5 X_4_0_99_3:1.1.1.5 X_4_0_99_3-20010501-preimport:1.1.1.5 bsd-2-0-0-branch:1.1.1.5.0.4 X_4_0_99_2-20010410-merge:1.1.1.5 X_4_0_99_2:1.1.1.5 X_4_0_99_2-20010409-preimport:1.1.1.5 ati-pcigart-1-0-0-20010405-merge:1.1.1.5 ati-pcigart-1-0-0-20010405:1.1.1.5 ati-pcigart-1-0-0-20010405-freeze:1.1.1.5 ati-pcigart-1-0-0-branch:1.1.1.5.0.2 mesa-3-5-20010323-freeze:1.1.1.4 X_4_0_99_1-20010321-merge:1.1.1.5 X_4_0_99_1:1.1.1.5 X_4_0_99_1-20010319-preimport:1.1.1.4 full-1-0-0-20010315-head:1.1.1.4 sarea-1-0-0-20010314-merge:1.1.1.4 sarea-1-0-0-20010314:1.1.1.4 full-1-0-0-branch:1.1.1.4 sarea-1-0-0-20010307:1.1.1.4 sarea-1-0-0-20010307-freeze:1.1.1.4 tdfx-3-1-0-20010306-merge:1.1.1.4 tdfx-3-1-0-20010306-freeze:1.1.1.4 tdfx-3-1-0-20010306:1.1.1.4 tdfx-3-1-0-20010305-merge:1.1.1.4 tdfx-3-1-0-20010305-freeze2:1.1.1.4 tdfx-3-1-0-20010305-freeze:1.1.1.4 tdfx-3-1-0-20010301-freeze:1.1.1.4 ati-pcigart-0-0-1-branch-02282001-freeze:1.1.1.4 ati-5-0-1-20010220-head:1.1.1.4 ati-5-0-1-branch:1.1.1.4.0.14 sarea-1-0-0-branch:1.1.1.4.0.12 mga-1-0-0-20010215-merge:1.1.1.4 mga-1-0-0-20010215-freeze:1.1.1.4 tdfx-3-1-0-branch:1.1.1.4.0.10 tdfx-3-0-1-branch:1.1.1.4 ati-pcigart-0-0-1-branch:1.1.1.4.0.8 mesa-3-5-branch:1.1.1.4.0.6 tdfx-3-0-0-20010109-merge:1.1.1.4 tdfx-3-0-0-20010108:1.1.1.3.2.1 ati-5-0-0-20010105-merge:1.1.1.4 ati-5-0-0-20010105:1.1.1.3.12.1 ati-5-0-0-20000104-freeze:1.1.1.3.12.1 tdfx-3-0-0-20010104-freeze:1.1.1.3.2.1 ati-5-0-0-20001223-merge:1.1.1.3.12.1 ati-5-0-0-20001223-freeze:1.1.1.3 X_4_0_2-20001221-merge:1.1.1.4 X_4_0_2:1.1.1.4 mga-1-0-0-branch:1.1.1.4.0.4 X_4_0_1h-20001207-merge:1.1.1.4 X_4_0_1h-20001205-merge:1.1.1.4 X_4_0_1h:1.1.1.4 ati-4-1-1-20001202-merge-trunk:1.1.1.4 sse-1-0-1-branch:1.1.1.4.0.2 ati-4-1-1-20001202-merge:1.1.1.1.52.1 tdfx-3-0-0-20001201:1.1.1.3.2.1 ati-4-1-1-20001201-freeze:1.1.1.1 tdfx-3-0-0-20001201-freeze:1.1.1.3 X_4_0_1g-20001130-merge:1.1.1.4 X_4_0_1g:1.1.1.4 X_4_0_1f-20001130-merge:1.1.1.4 X_4_0_1f:1.1.1.4 ati-4-1-1-20001125-freeze:1.1.1.1 mach64-0-0-1-branch:1.1.1.3.0.14 ati-5-0-0-branch:1.1.1.3.0.12 X_4_0_1e-20001107-merge:1.1.1.3 X_4_0_1e:1.1.1.3 X_4_0_1d-20001107-merge:1.1.1.3 X_4_0_1d:1.1.1.3 ppc-1-0-1-branch:1.1.1.3.0.10 radeon-1-0-0-20001017:1.1.1.1 full-0-0-2-branch:1.1.1.3.0.8 full-0-0-1-branch:1.1.1.3.0.6 ati-4-1-1-20001009-freeze:1.1.1.1 mga-readpix-0-0-1-branch:1.1.1.3.0.4 tdfx-3-0-0-branch:1.1.1.3.0.2 X_4_0_1d-pre:1.1.1.3 ati-4-1-1-20000919-stable:1.1.1.1 radeon-1-0-0-branch:1.1.1.1.0.66 ppc-1-0-0-20000912:1.1.1.1 mga-lock-debug-0-2-0-branch:1.1.1.1.0.64 sse-1-0-0-branch:1.1.1.1.0.62 mga-lock-debug-0-0-1-branch:1.1.1.1.0.60 gamma-2-0-0-branch:1.1.1.1.0.58 tdfx-2-1-20000907-merge:1.1.1.1 tdfx-2-1-20000906:1.1.1.1 tdfx-2-1-20000905-freeze:1.1.1.1 ppc-1-0-0-2000-09-01-freeze:1.1.1.1 m3-0-0-1-branch:1.1.1.1.0.56 mach64-0-0-0-branch:1.1.1.1.0.54 ati-4-1-1-branch:1.1.1.1.0.52 X_4_0_1b-20000816-merge:1.1.1.1 X_4_0_1b:1.1.1.1 ati-4-0-2-branch:1.1.1.1.0.50 ppc-1-0-0-branch:1.1.1.1.0.48 tdfx-2-1-20000711:1.1.1.1 tdfx-2-1-20000711-freeze:1.1.1.1 X_4_0_1:1.1.1.1 tdfx-2-1-branch:1.1.1.1.0.46 pre401-20000613-freeze:1.1.1.1 bsd-1-0-1-20000613-merge:1.1.1.1 bsd-1-0-1-20000613:1.1.1.1 bsd-1-0-1-20000612-freeze:1.1.1.1 tdfx-2-0-20000612-merge:1.1.1.1 ati-4-1-0-20000613-merge:1.1.1.1 ati-4-1-0-20000613:1.1.1.1 tdfx-2-0-20000608-merge:1.1.1.1 tdfx-2-0-20000608-freeze:1.1.1.1 ati-4-1-0-branch:1.1.1.1.0.44 glxmisc-3-0-0-20000608-merge:1.1.1.1 glxmisc-3-0-0-20000607:1.1.1.1 glxmisc-3-0-0-20000606-freeze:1.1.1.1 bsd-1-0-1-branch:1.1.1.1.0.42 bsd-1-0-0-20000531-merge:1.1.1.1 bsd-1-0-0-20000530-merge:1.1.1.1 bsd-1-0-0-20000530-freeze:1.1.1.1 tdfx-2-0-20000222-merge:1.1.1.1 tdfx-2-0-20000222-freeze:1.1.1.1 ati-4-0-1-20000518-merge:1.1.1.1 ati-4-0-1-20000518:1.1.1.1 video-1-0-0-branch:1.1.1.1.0.40 gamma-1-0-0-branch:1.1.1.1.0.38 mgadh-0-0-3-branch:1.1.1.1.0.36 glxmisc-3-0-0-branch:1.1.1.1.0.34 glxmisc-2-0-0-20000503-merge:1.1.1.1 bsd-1-0-0-branch:1.1.1.1.0.32 glxmisc-2-0-0-20000503:1.1.1.1 glxmisc-2-0-0-branch:1.1.1.1.0.30 tdfx-2-0-branch:1.1.1.1.0.28 tdfx-2-0-trunk:1.1.1.1 glxmisc-1-0-0-20000420-merge:1.1.1.1 glxmisc-1-0-0-20000420:1.1.1.1 ati-4-0-1-beta:1.1.1.1 glxmisc-1-0-0-branch:1.1.1.1.0.26 mga-0-0-3-branch:1.1.1.1.0.24 mga-0-0-2-20000404-merge:1.1.1.1 ati-4-0-1-alpha:1.1.1.1 ati-4-0-1-20000319-base:1.1.1.1 ati-4-0-1-branch:1.1.1.1.0.22 ati-4-0-0-20000319:1.1.1.1 X_4_0-20000315-merge:1.1.1.1 X_4_0:1.1.1.1 freeze-20000226:1.1.1.1 dispatch-0-0-3-20000225-merge:1.1.1.1 dispatch-0-0-3-20000225:1.1.1.1 mga-0-0-1-20000225-merge:1.1.1.1 mga-0-0-2-branch:1.1.1.1.0.20 smt-0-0-2-branch:1.1.1.1.0.18 smt-0-0-1-20000222-freeze:1.1.1.1 X_3_9_18-20000222-merge:1.1.1.1 X_3_9_18:1.1.1.1 smt-0-0-1-stage2c:1.1.1.1 smt-0-0-1-stage2b:1.1.1.1.0.16 dispatch-0-0-3-branch:1.1.1.1.0.14 i810-20000214-beta2:1.1.1.1 dispatch-0-0-2-20000212:1.1.1.1 dispatch-0-0-2-branch:1.1.1.1.0.12 i810-20000201-beta1:1.1.1.1 dispatch-0-0-1-20000129-merge:1.1.1.1 dispatch-0-0-1-20000128:1.1.1.1 smt-0-0-1-20000112-base:1.1.1.1 smt-0-0-1-branch:1.1.1.1.0.6 dispatch-0-0-1-branch:1.1.1.1.0.10 tdfx-1-1:1.1.1.1.0.4 X_3_9_17:1.1.1.1 ati-4-0-0-branch:1.1.1.1.0.8 mga-0-0-1-branch:1.1.1.1.0.2 X_3_9_16:1.1.1.1 XFree:1.1.1; locks; strict; comment @ * @; 1.3 date 2003.09.12.22.16.42; author alanh; state Exp; branches; next 1.2; 1.2 date 2001.08.25.03.13.04; author dawes; state dead; branches; next 1.1; 1.1 date 99.12.05.01.02.11; author daryll; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.12.05.01.02.11; author daryll; state Exp; branches 1.1.1.1.52.1 1.1.1.1.58.1; next 1.1.1.2; 1.1.1.2 date 2000.09.22.17.22.38; author alanh; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2000.09.23.20.55.29; author alanh; state Exp; branches 1.1.1.3.2.1 1.1.1.3.12.1; next 1.1.1.4; 1.1.1.4 date 2000.11.30.17.30.30; author dawes; state Exp; branches 1.1.1.4.6.1; next 1.1.1.5; 1.1.1.5 date 2001.03.19.17.45.19; author dawes; state Exp; branches 1.1.1.5.4.1; next 1.1.1.6; 1.1.1.6 date 2001.08.22.18.00.16; author dawes; state Exp; branches; next ; 1.1.1.5.4.1 date 2001.08.29.17.24.55; author alanh; state dead; branches; next ; 1.1.1.4.6.1 date 2001.03.27.20.02.55; author gareth; state Exp; branches; next ; 1.1.1.3.2.1 date 2000.12.01.14.22.05; author alanh; state Exp; branches; next ; 1.1.1.3.12.1 date 2000.12.23.06.47.37; author gareth; state Exp; branches; next ; 1.1.1.1.52.1 date 2000.12.01.20.38.21; author gareth; state Exp; branches; next ; 1.1.1.1.58.1 date 2001.02.15.16.59.08; author alanh; state Exp; branches; next ; desc @@ 1.3 log @xc/programs/Xserver/os now has a dependency on the newer lib/Xdmcp/Xdmcp.h header file due to the IPv6 changes. So we now import libXdmcp and turn this on. @ text @/* * $Xorg: GenKey.c,v 1.4 2001/02/09 02:03:48 xorgcvs Exp $ * * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * * Author: Keith Packard, MIT X Consortium */ /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.8 2001/12/14 19:54:54 dawes Exp $ */ #include #include #include #include static void getbits (long data, unsigned char *dst) { dst[0] = (data ) & 0xff; dst[1] = (data >> 8) & 0xff; dst[2] = (data >> 16) & 0xff; dst[3] = (data >> 24) & 0xff; } #define Time_t time_t #include #if defined(SYSV) || defined(SVR4) #define srandom srand48 #define random lrand48 #endif void XdmcpGenerateKey (XdmAuthKeyPtr key) { long lowbits, highbits; srandom ((int)getpid() ^ time((Time_t *)0)); lowbits = random (); highbits = random (); getbits (lowbits, key->data); getbits (highbits, key->data + 4); } @ 1.2 log @- Remove the rest of the unneeded client-side libraries. - Use installed libraries that are not built here. - Don't build/install client-library related file and headers. @ text @d2 1 a2 1 * $TOG: GenKey.c /main/7 1998/02/06 14:39:49 kaleb $ d7 5 a11 1 All Rights Reserved. d30 1 a30 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.4 1998/10/21 06:12:00 dawes Exp $ */ a45 5 /* EMX is not STDC, but sometimes it is */ #if defined(X_NOT_STDC_ENV) && !defined(__EMX__) #define Time_t long extern Time_t time (); #else a46 1 #endif a47 1 #if defined(linux) || defined(CSRG_BASED) || (defined(sun) && defined(SVR4)) a48 3 #else long random(); #endif @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import XFree 3.9.16 @ text @@ 1.1.1.1.58.1 log @merge trunk into gamma-2-0-0-branch @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.5 2000/11/14 18:20:33 dawes Exp $ */ d50 1 a50 1 #ifndef X_NOT_STDC_ENV @ 1.1.1.1.52.1 log @Merge with trunk (almost there!). @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.5 2000/11/14 18:20:33 dawes Exp $ */ d50 1 a50 1 #ifndef X_NOT_STDC_ENV @ 1.1.1.2 log @Import of XFree86 4.0.1d-pre @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.3 1998/10/10 15:25:14 dawes Exp $ */ @ 1.1.1.3 log @Import of XFree86 4.0.1d-pre (2) @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.4 1998/10/21 06:12:00 dawes Exp $ */ @ 1.1.1.3.12.1 log @Merge in XFree86 4.0.2 updates from trunk. @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.5 2000/11/14 18:20:33 dawes Exp $ */ d50 1 a50 1 #ifndef X_NOT_STDC_ENV @ 1.1.1.3.2.1 log @merge trunk into tdfx-3-0-0-branch freeze tag before merge is tdfx-3-0-0-20001201-freeze @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.5 2000/11/14 18:20:33 dawes Exp $ */ d50 1 a50 1 #ifndef X_NOT_STDC_ENV @ 1.1.1.4 log @Import of XFree86 4.0.1f @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.5 2000/11/14 18:20:33 dawes Exp $ */ d50 1 a50 1 #ifndef X_NOT_STDC_ENV @ 1.1.1.4.6.1 log @Initial merge of trunk onto branch. @ text @d2 1 a2 1 * $Xorg: GenKey.c,v 1.3 2000/08/17 19:45:48 cpqbld Exp $ d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.6 2001/01/17 19:42:43 dawes Exp $ */ @ 1.1.1.5 log @Import of XFree86 4.0.99.1 @ text @d2 1 a2 1 * $Xorg: GenKey.c,v 1.3 2000/08/17 19:45:48 cpqbld Exp $ d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.6 2001/01/17 19:42:43 dawes Exp $ */ @ 1.1.1.5.4.1 log @merge from trunk. @ text @@ 1.1.1.6 log @Import of XFree86 4.1.99.1 @ text @d26 1 a26 1 /* $XFree86: xc/lib/Xdmcp/GenKey.c,v 3.7 2001/07/25 15:04:50 dawes Exp $ */ d42 5 d48 1 d50 1 d52 3 @