From xemacs-m  Wed Feb  5 11:31:48 1997
Received: from sym.primuscorp.com (root@[207.14.28.20])
	by xemacs.org (8.8.5/8.8.5) with SMTP id LAA00897
	for <xemacs-beta@xemacs.org>; Wed, 5 Feb 1997 11:31:46 -0600 (CST)
Received: from horus (horus.primuscorp.com [198.187.136.23]) by sym.primuscorp.com (8.6.11/8.6.9) with ESMTP id JAA01531; Wed, 5 Feb 1997 09:49:48 -0800
Received: from roy by horus (SMI-8.6/SMI-SVR4)
	id JAA08420; Wed, 5 Feb 1997 09:30:22 -0800
Received: by roy (SMI-8.6/SMI-SVR4)
	id JAA00977; Wed, 5 Feb 1997 09:30:37 -0800
Date: Wed, 5 Feb 1997 09:30:37 -0800
Message-Id: <199702051730.JAA00977@roy>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Damon Lipparelli <lipp@primus.com>
To: sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Cc: xemacs-beta@xemacs.org
Subject: Re: EFS 1.15 for XEmacs, release x2
In-Reply-To: <y9lwwsnva4d.fsf@modas.informatik.uni-tuebingen.de>
References: <y9llo94x5b2.fsf@modas.informatik.uni-tuebingen.de>
	<199702050111.RAA29779@roy>
	<y9lwwsnva4d.fsf@modas.informatik.uni-tuebingen.de>
Reply-To: Damon Lipparelli <lipp@primus.com>
Organization: Primus Communications Corporation
X-Mailer: VM 6.11 [ XEmacs 20.0 (test1) ]

>>>>> Michael Sperber [Mr Preprocessor] <sperber@informatik.uni-tuebingen.de> writes:

>>>>> "Damon" == Damon Lipparelli <lipp@primus.com> writes:
    Damon> [1 <text/plain; us-ascii (7bit)>] To get this working
    Damon> consistently under XEmacs 20.0, I had to apply the following
    Damon> patch:

    Damon> !  (setq efs-passwd-seed (abs (% (random t) 256)))))
  
    > This stuff is giving me pain to no end.  What sort of errors do you
    > get?

In this function:

(defun efs-code-string (string)
  ;; Encode a string, using `efs-passwd-seed'. This is nil-potent,
  ;; meaning applying it twice decodes.
  (if (and (fboundp 'int-char) (fboundp 'char-int))
      (mapconcat
       (function
	(lambda (c)
	  (char-to-string
	   (int-char (logxor (efs-get-passwd-seed) (char-int c))))))
       string "")
    (mapconcat
     (function
      (lambda (c)
	(char-to-string (logxor (efs-get-passwd-seed) c))))
     string "")))

(efs-get-passwd-seed) sometimes is a negative number.  logxor'ing this
against each (char-int c) returns a negative number.  int-char'ing this
value returns 'nil.  char-to-string was complaining that 'nil isn't a
character.

-lipp

ps: Couldn't we also fix this with the following change?

(defun efs-get-passwd-seed ()
  ;; Returns a random number to use for encrypting passwords.
  (or efs-passwd-seed
      (setq efs-passwd-seed (random 256))))

---

HAIR TONICS, please!!

