Send MinGW-Notify mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.osdn.me/mailman/listinfo/mingw-notify
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-Notify digest..."


Please do not reply to this notification; the sender address is unable to 
accept incoming e-mail.  If you wish to unsubscribe you can do so at 
https://lists.osdn.me/mailman/listinfo/mingw-notify.



Today's Topics:

   1. [mingw] #39658: mingwrt 5.2.2 does not expose function
      rand_s? (MinGW Notification List)
   2. [mingw] #39658: mingwrt 5.2.2 does not expose function
      rand_s? (MinGW Notification List)
   3. [mingw] #39658: mingwrt 5.2.2 does not expose function
      rand_s? (MinGW Notification List)
   4. [mingw] #39658: mingwrt 5.2.2 does not expose function
      rand_s? (MinGW Notification List)


----------------------------------------------------------------------

Message: 1
Date: Wed, 09 Oct 2019 17:21:11 +0100
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #39658: mingwrt 5.2.2 does not expose
        function rand_s?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#39658: mingwrt 5.2.2 does not expose function rand_s?

  Open Date: 2019-10-06 13:50
Last Update: 2019-10-09 17:21

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2019-10-09 17:21 Updated by: keith

Comment:

I've attached a (https://osdn.net/ticket/download.php?group_id=3917&tid=39658&;
file_id=5565 proposed patch), which I plan to add for mingwrt-5.3. This
generally conforms to Microsoft documentation, insofar as it:—

  • requires the user to define the _CRT_RAND_S feature test macro;
  • requires linking with MSVCR80.DLL from WinXP onward, or Vista onward for
    linking with MSVCRT.DLL;
  • exhibits documented arguments signature.

It differs from Microsoft's documented prototype, in respect of returning int
rather than errno_t; my rationale for this is:—

  • errno_t is not an ISO-C standard type;
  • all versions of ISO-C require that errno, itself, is of type int;
  • versions of ISO-C, prior to C11, make no reference of errno_t, and POSIX.1
    neither requires, nor supports it;
  • although C11 and C18 do allow errno_t, as an optional typedef to int,
    neither requires it, but both do require the option to be enabled by use of
    the __STDC_WANT_LIB_EXT1__ feature test macro; Microsoft's usage
    contravenes these standards, by neglecting this requirement, (and the
    complementary requirement for the compiler implementation to define
    __STDC_LIB_EXT1__, to indicate availability of the option);
  • use of errno_t may, (and often does), conflict with GNU C's internal
    prototypes, (although unlikely in this particular instance);
  • elsewhere, MinGW always uses standard int, in place of non-standard
    errno_t.



---------------------------------------------------------------------
Ticket Status:

      Reporter: sping
         Owner: (None)
          Type: Issues
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: WSL
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Hi!

Windows introduced function rand_s some time and while I find mention of it in
MinGW's msvcrt-xref.pdf I cannot find a signature for it in mingwrt 5.2.2
headers. Are there plans to add a prototype to MinGW? We're about to define a
prototype in https://github.com/libexpat/libexpat/pull/356/files for MinGW in
Expat ourselves now but it seems like the real fix would be to have it in MinGW
for everyone — what do you think?

On a side note, msvcrt-xref.pdf says that rand_s is not contained in Windows XP
but contained in Windows Vista an after. The way I read the MS docs they imply
availability in Windows XP but it might be wishful thinking — if you know for
sure, I'd be interested in more details.

Thanks and best, Sebastian



-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658


------------------------------

Message: 2
Date: Wed, 09 Oct 2019 19:33:19 +0200
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #39658: mingwrt 5.2.2 does not expose
        function rand_s?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#39658: mingwrt 5.2.2 does not expose function rand_s?

  Open Date: 2019-10-06 14:50
Last Update: 2019-10-09 19:33

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2019-10-09 19:33 Updated by: sping

Comment:

Sounds pretty good to me!

I wonder: Will I have a chance to distinguish versions of mingwrt declaring
rand_s from those that don't on pre-processor level from within Expat code? I
don't find anything like that at https://sourceforge.net/p/predef/wiki/
Compilers/ . Are there mingwrt specific version defines that I can check for?

PS: Do you have links / sources about why rand_s and RtlGenRandom are not more
secure than rand despite not being devoid of entropy, as you mention in the
patch comment and above?



---------------------------------------------------------------------
Ticket Status:

      Reporter: sping
         Owner: (None)
          Type: Issues
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: WSL
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Hi!

Windows introduced function rand_s some time and while I find mention of it in
MinGW's msvcrt-xref.pdf I cannot find a signature for it in mingwrt 5.2.2
headers. Are there plans to add a prototype to MinGW? We're about to define a
prototype in https://github.com/libexpat/libexpat/pull/356/files for MinGW in
Expat ourselves now but it seems like the real fix would be to have it in MinGW
for everyone — what do you think?

On a side note, msvcrt-xref.pdf says that rand_s is not contained in Windows XP
but contained in Windows Vista an after. The way I read the MS docs they imply
availability in Windows XP but it might be wishful thinking — if you know for
sure, I'd be interested in more details.

Thanks and best, Sebastian



-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658


------------------------------

Message: 3
Date: Wed, 09 Oct 2019 18:44:29 +0100
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #39658: mingwrt 5.2.2 does not expose
        function rand_s?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#39658: mingwrt 5.2.2 does not expose function rand_s?

  Open Date: 2019-10-06 13:50
Last Update: 2019-10-09 18:44

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2019-10-09 18:44 Updated by: keith

Comment:

Could someone please apply and test this for me; right now, I don't have a
convenient Windows host to do so myself.



---------------------------------------------------------------------
Ticket Status:

      Reporter: sping
         Owner: (None)
          Type: Issues
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: WSL
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Hi!

Windows introduced function rand_s some time and while I find mention of it in
MinGW's msvcrt-xref.pdf I cannot find a signature for it in mingwrt 5.2.2
headers. Are there plans to add a prototype to MinGW? We're about to define a
prototype in https://github.com/libexpat/libexpat/pull/356/files for MinGW in
Expat ourselves now but it seems like the real fix would be to have it in MinGW
for everyone — what do you think?

On a side note, msvcrt-xref.pdf says that rand_s is not contained in Windows XP
but contained in Windows Vista an after. The way I read the MS docs they imply
availability in Windows XP but it might be wishful thinking — if you know for
sure, I'd be interested in more details.

Thanks and best, Sebastian



-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658


------------------------------

Message: 4
Date: Wed, 09 Oct 2019 19:18:16 +0100
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #39658: mingwrt 5.2.2 does not expose
        function rand_s?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#39658: mingwrt 5.2.2 does not expose function rand_s?

  Open Date: 2019-10-06 13:50
Last Update: 2019-10-09 19:18

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2019-10-09 19:18 Updated by: keith

Comment:

Reply To sping

    I wonder: Will I have a chance to distinguish versions of mingwrt declaring
    rand_s from those that don't on pre-processor level from within Expat code?
    I don't find anything like that at https://sourceforge.net/p/predef/wiki/
    Compilers/ . Are there mingwrt specific version defines that I can check
    for?

You can test the value of __MINGW32_VERSION, (a long integer value), which is
defined in <_mingw.h>, (and thus always defined after any system header has
been included). Its relationship to the mingwrt version is explained in
<_mingw.h.in>; you will need to test for

 1.  #if __MINGW32_VERSION >= 5003000L

    PS: Do you have links / sources about why rand_s and RtlGenRandom are not
    more secure than rand despite not being devoid of entropy, as you mention
    in the patch comment and above?

In what way do you think rand() is insecure? In what respect would rand_s() be
considered more secure? (Security implies user authentication — an operation
which neither of these functions performs).



---------------------------------------------------------------------
Ticket Status:

      Reporter: sping
         Owner: (None)
          Type: Issues
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: WSL
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Hi!

Windows introduced function rand_s some time and while I find mention of it in
MinGW's msvcrt-xref.pdf I cannot find a signature for it in mingwrt 5.2.2
headers. Are there plans to add a prototype to MinGW? We're about to define a
prototype in https://github.com/libexpat/libexpat/pull/356/files for MinGW in
Expat ourselves now but it seems like the real fix would be to have it in MinGW
for everyone — what do you think?

On a side note, msvcrt-xref.pdf says that rand_s is not contained in Windows XP
but contained in Windows Vista an after. The way I read the MS docs they imply
availability in Windows XP but it might be wishful thinking — if you know for
sure, I'd be interested in more details.

Thanks and best, Sebastian



-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/39658
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39658


------------------------------

Subject: Digest Footer

_______________________________________________
MinGW-Notify mailing list
[email protected]
https://lists.osdn.me/mailman/listinfo/mingw-notify


------------------------------

End of MinGW-Notify Digest, Vol 25, Issue 4
*******************************************

Reply via email to