On Thu, Jul 19, 2001 at 01:38:17PM -0400, Sundaram, Mani wrote:
> I am in the process of porting OpenSSL to our platform that does not support
> Unix sockets and does not have a /dev/urandom entropy device.
> I am able to get the prngd daemon(to generate random numbers) to run on the
> localhost at a desired port, but don't know how to 
> interface this with the OpenSSL functions that look for an egd socket in
> /var/run/egd-pool or /dev/egd-pool. 
> 
> Does anyone have an idea?

Hmm. The difference should not be that large. In general,
crypto/rand/rand_egd.c uses

        struct sockaddr_un addr;
        ...
        memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
        if (strlen(path) > sizeof(addr.sun_path))
                return (-1);
        strcpy(addr.sun_path,path);
        len = offsetof(struct sockaddr_un, sun_path) + strlen(path);
        fd = socket(AF_UNIX, SOCK_STREAM, 0);

to setup things. The thing needed would be something like

  struct sockaddr_in sockin;
  memset(&sockin, 0, sizeof(sockin));
  sockin.sin_family = AF_INET;
  sockin.sin_port = htons(port);
  sockin.sin_addr.s_addr = inet_addr("127.0.0.1");
  len = sizeof(sockin);
  fd = socket(AF_INET, SOCK_STREAM, 0);
  ...

So actually the change/extension to OpenSSL would be really small...
With a syntax like "tcp/localhost:port" one could even keep the API
unchanged...

Thinking about it, waiting for input...
        Lutz
-- 
Lutz Jaenicke                             [EMAIL PROTECTED]
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to