public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Tietz <ktietz70@googlemail.com>
To: Dave Korn <dave.korn.cygwin@googlemail.com>
Cc: Andrew Haley <aph@redhat.com>, gcc@gcc.gnu.org, java@gcc.gnu.org
Subject: Re: RFA: libjava seems to miss some files for win32
Date: Sat, 18 Jul 2009 17:27:00 -0000	[thread overview]
Message-ID: <90baa01f0907181027q47631936ib9fd57b733586ce4@mail.gmail.com> (raw)
In-Reply-To: <4A6204A3.6040704@gmail.com>

2009/7/18 Dave Korn <dave.korn.cygwin@googlemail.com>:
> Kai Tietz wrote:
>
>>       * gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: Implementation
>>       for native win32.
>>
>> Tested for x86 and x64 mingw targets. Ok for apply?
>
> +  for (a = 0; a < length; a++, count++)
> +   *bytes++= (jbyte) rand ();
>
>  Surely not, the standard C library rand() function is completely unsuitable
> for security purposes.  It should use the win32 crypto api to get real
> high-quality random data I think.
>
>    cheers,
>      DaveK
>
>

Yes, I agree to this as I said in the patch post. Can we assume that
any win32 target has a working wincrypt.h file?
I just suggested this patch, to have at least an implementation here
for win32 for further improvement (Btw I missed in my initial patch to
include explicit <stdlib.h> here, too).
I am just running through libjava for an initial port for x64 windows.
There are a lot of assumptions about sizeof (long) == sizeof (void*),
but the worse thing I see is the casting of HANDLE values to jint. For
x86 this is fine, but for x64 this can lead to serious troubles.

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

  reply	other threads:[~2009-07-18 17:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <90baa01f0907180506h1a58152du5d45d66628043ad9@mail.gmail.com>
2009-07-18 13:53 ` Dave Korn
2009-07-18 16:01   ` Kai Tietz
2009-07-18 17:09     ` Dave Korn
2009-07-18 17:27       ` Kai Tietz [this message]
2009-07-18 18:15         ` Dave Korn
2009-07-18 19:09           ` Andrew Haley
2009-07-18 19:19             ` Andrew Pinski
2009-07-18 19:23               ` Kai Tietz
2009-07-18 19:29                 ` Andrew Pinski
2009-07-19 11:13                   ` Kai Tietz
2009-07-19 13:16                     ` Dave Korn
2009-07-19 13:31                       ` Kai Tietz
2009-07-19 13:45                         ` Dave Korn
2009-07-19 13:55                           ` Kai Tietz
2009-07-19 14:39                             ` Dave Korn
2009-07-19 15:23                       ` Andrew Haley
2009-07-19 17:07                         ` Dave Korn
2009-07-18 19:23               ` Dave Korn
2009-07-18 19:27                 ` Kai Tietz
2009-07-18 18:27         ` Dave Korn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90baa01f0907181027q47631936ib9fd57b733586ce4@mail.gmail.com \
    --to=ktietz70@googlemail.com \
    --cc=aph@redhat.com \
    --cc=dave.korn.cygwin@googlemail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).