From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 15 Oct 1996 16:02:29 -0700 From: beto@plan9.cs.su.oz.au beto@plan9.cs.su.oz.au Subject: encrypt/decrypt not thread safe Topicbox-Message-UUID: 4ee292b6-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19961015230229.bMAD2Ckdf5gOqIWmKfMVrhyG_HFACRyhL2TN6wJAIvs@z> Tracing a kernel bug we found that encrypt/decrypt are not multi-thread safe. They save some values in global memory. This is ok for user programs but can cause authentication errors inside the kernel. Those are the static variables used in des_encrypt: /* * The current block, divided into 2 halves. */ static char L[64], *R = L+32; static char tempL[32]; static char f[32]; /* * The combination of the key and the input, before selection. */ static char preS[48]; Could I move those variables inside des_encrypt??? I compiles but I'm not sure the code would be correct, some reference could be set to L, temp, or f? Any comments would be appreciated.