9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* encrypt/decrypt not thread safe
@ 1996-10-16  7:49 forsyth
  0 siblings, 0 replies; 6+ messages in thread
From: forsyth @ 1996-10-16  7:49 UTC (permalink / raw)


>>Is the source on that CD-ROM identical to the currently  invisible source?

it compiled to the same binary last time i tried.  i used it for a port





^ permalink raw reply	[flat|nested] 6+ messages in thread

* encrypt/decrypt not thread safe
@ 1996-10-17  9:07 Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Boyd @ 1996-10-17  9:07 UTC (permalink / raw)


    From: forsyth@plan9.cs.york.ac.uk

    boyd might be able to offer a safe replacement that's not subject
    to pointless controls.

you can certainly take my des from ftp://www.plan9.cs.su.oz.au/~boyd/des.msg
but it's not thread safe.  it assumes it's being called by a single
threaded program.  to fix it you need to have a per thread expanded
key.  all you need to do is to change deskey() to accept a parameter
for where to store the expanded key , rather than storing it in a
global static.  not real hard.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* encrypt/decrypt not thread safe
@ 1996-10-16  7:03 Christopher.Vance
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher.Vance @ 1996-10-16  7:03 UTC (permalink / raw)


forsyth@plan9.cs.york.ac.uk wrote:
|  the version of the routine you've picked (looks like the old unix one,
|  also non-exportable, but people slip up) isn't safe.  i'm fairly sure
|  the binary version shipped as crypt.*.save is fine.  
|  boyd might be able to offer a safe replacement that's not subject to pointless controls.

The previous CD-ROM did include source and I'm sure Beto can get hold 
of it.  Is the source on that CD-ROM identical to the currently 
invisible source?

-- Christopher




^ permalink raw reply	[flat|nested] 6+ messages in thread

* encrypt/decrypt not thread safe
@ 1996-10-16  6:09 forsyth
  0 siblings, 0 replies; 6+ messages in thread
From: forsyth @ 1996-10-16  6:09 UTC (permalink / raw)


>>i'm fairly sure the binary version shipped as crypt.*.save is fine.

indeed, i'm certain.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* encrypt/decrypt not thread safe
@ 1996-10-16  6:07 forsyth
  0 siblings, 0 replies; 6+ messages in thread
From: forsyth @ 1996-10-16  6:07 UTC (permalink / raw)


you've supplied your own crypt routine because the real one
isn't included in the distribution for the usual silly reason
(it's illegal in the US to export dangerous cryptographic routines
that anyone in the world can type in from a book they can buy freely).

the version of the routine you've picked (looks like the old unix one,
also non-exportable, but people slip up) isn't safe.  i'm fairly sure
the binary version shipped as crypt.*.save is fine.  
boyd might be able to offer a safe replacement that's not subject to pointless controls.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* encrypt/decrypt not thread safe
@ 1996-10-15 23:02 beto
  0 siblings, 0 replies; 6+ messages in thread
From: beto @ 1996-10-15 23:02 UTC (permalink / raw)


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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-10-17  9:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-16  7:49 encrypt/decrypt not thread safe forsyth
  -- strict thread matches above, loose matches on Subject: below --
1996-10-17  9:07 Boyd
1996-10-16  7:03 Christopher.Vance
1996-10-16  6:09 forsyth
1996-10-16  6:07 forsyth
1996-10-15 23:02 beto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).