Page MenuHome GnuPG

INT2FD and npth_accept
Testing, NormalPublic

Description

For 64-bit Windows, there is a potential problem in the use case:

  • INT2FD with the return value from npth_accept

By the API of npth_accept, it returns type int, which may not be good when/if 64-bit value is used for SOCKET.

Candidates are:
(1) Change the API/ABI of nPth

  • Remove INT2FD before npth_accept
  • Change the API/ABI of npth_accept
    • let it return (void *) on Windows

(2) Use plain accept

  • Remove INT2FD before npth_accept
  • No use of npth_accept, but use the combo of npth_unprotect, accept, and npth_protect
    • Use a type conversion to (void *) from SOCKET to be gnupg_fd_t for accept

(3) No fix

  • Ignore the fact that the masking to lower 32-bit occurs in npth_accept (from accept)

Event Timeline

gniibe triaged this task as Normal priority.Jul 19 2023, 6:15 AM
gniibe created this task.
gniibe created this object with edit policy "Contributor (Project)".

Another approach would be:

  • Use assuan_sock_accept which has consistent API with gnupg_fd_t

See T5925: libassuan: Add assuan_sock_accept function to the API

gniibe changed the task status from Open to Testing.Aug 4 2023, 2:36 AM

assuan_sock_accept approach is taken in gnupg master.