getsockopt() needs privileged certificate ? RRS feed

  • Question

  • Hi folks,

    My frustration comes from using getsockopt() and setsockopt().
    My application is running in unprivileged mode, and I've been using a phone unlocked by Security Configuration Manager, i.e., all applications have privileged access.
    Now, I've changed the security setting of the phone to "two-tier prompt", i.e., my unsigned application will only have unprivileged access.
    Under this situation, getsockopt(SOL_SOCKET, SO_PROTOCOL_INFO, ...) call fails with GetLastError()=WSAEFAULT. However, setsockopt() still works fine.
    The same code works just fine as soon as I change phone's security setting to "one-tier prompt" or "security off".
    Per msdn documentation, getsockopt() is not listed in the "trusted API".

    Am I missing something obvious?
    I've checked this happening on two Samsung phones and one HTC phone running 6.1 standard and 6.1 professional.

    Any comment would be greatly appreciated.
    Friday, May 1, 2009 5:42 PM


  • Two things
    1) some times some of the api's need to access the registry tree to get the info and these registry entries can be protected.
    2) you can use the test certificate provided with the SDK to sign your application and the program should work fine in two tier.
    • Marked as answer by warrentang Thursday, May 7, 2009 6:44 AM
    Saturday, May 2, 2009 8:11 PM