×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    20

    Symbian Signed & Security

    Hi All.

    I wrote a script that uses the positioning module. The script works fine in the emulator and when launched from the python shell on my phone.

    I used ensymble to create a .sis file of my script and signed it using open signed (using my phone's IMEI).

    The application should have access to all phone subsytems as i signed the application with all capabilities, but when i use the positioning module i get a access denied exception.

    Here is a snippet of the application i wrote to test positioning in a .sis file.

    Code:
    import appuifw
    import e32
    import positioning
    import traceback
    import sys
    #import socket
    
    def main():
        try:
            lock = e32.Ao_lock()
            print positioning.modules()  
            appuifw.note(unicode(positioning.modules()), "error")
            lock.wait()        
        except:
            cla, exc, trbk = sys.exc_info()
            excName = cla.__name__
            try:
                excArgs = exc.__dict__["args"]
            except KeyError:
                excArgs = "<no args>"
            excTb = traceback.format_tb(trbk, 5)
            errorString = repr(excName) + '-' + repr(excArgs) + '-' + repr(excTb) + '\n'
            print errorString
            appuifw.note(u'Application errors, see log file for more information', "error")
            file = open(u'e:\\Python\\SosLog.txt','a')
            file.write(errorString)
            file.close()
            raise
    
    if __name__ == "__main__":
        main()
    The log file returned contains this text.

    'SymbianError'-(-46, 'KErrPermissionDenied')-[' File "C:\\private\\e29f58f5\\default.py", line 351, in main\n print positioning.modules()\n', ' File "c:\\resource\\positioning.py", line 54, in modules\n return _pos_serv.modules()\n']
    Why doesn't my application have access to the positioning module even though it was signed with this capability?
    Last edited by danieb_za; 2008-04-11 at 11:55.

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: Symbian Signed & Security

    Quote Originally Posted by danieb_za View Post
    Hi All.

    I wrote a script that uses the positioning module. The script works fine in the emulator and when launched from the python shell on my phone.

    I used ensymble to create a .sis file of my script and signed it using open signed (using my phone's IMEI).

    The application should have access to all phone subsytems as i signed the application with all capabilities, but when i use the positioning module i get a access denied exception.

    Here is a snippet of the application i wrote to test positioning in a .sis file.

    Code:
    import appuifw
    import e32
    import positioning
    import traceback
    import sys
    #import socket
    
    def main():
        try:
            lock = e32.Ao_lock()
            print positioning.modules()  
            appuifw.note(unicode(positioning.modules()), "error")
            lock.wait()        
        except:
            cla, exc, trbk = sys.exc_info()
            excName = cla.__name__
            try:
                excArgs = exc.__dict__["args"]
            except KeyError:
                excArgs = "<no args>"
            excTb = traceback.format_tb(trbk, 5)
            errorString = repr(excName) + '-' + repr(excArgs) + '-' + repr(excTb) + '\n'
            print errorString
            appuifw.note(u'Application errors, see log file for more information', "error")
            file = open(u'e:\\Python\\SosLog.txt','a')
            file.write(errorString)
            file.close()
            raise
    
    if __name__ == "__main__":
        main()
    The log file returned contains this text.


    Why doesn't my application have access to the positioning module even though it was signed with this capability?
    I did the same procedure with your script, and it doesnt returnany error.
    I signed it through the dev cert rather the opensigned online.

    Did you do anything superficial?
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    20

    Re: Symbian Signed & Security

    Hi.

    Here is the answer from the author of Ensymble Jussi Ylänen.

    The problem is, that when Ensymble creates a SIS file for your Python application, it also generates an EXE "stub", which is responsible for loading the Python interpreter when you select your application on the phone. (Symbian OS cannot figure out how to start Python programs directly, so this workaround is needed.) This EXE stub also contains a bit-mask of all the capabilities the program is going to use. You control this bit-mask with the --caps option of Ensymble.

    When installing a SIS, the phone check that no EXE (and DLL) files in it have more capabilities than what the SIS certificate allows, otherwise the installation is cancelled. However, in your case the EXE has no capabilities (as there was no --caps option on the command line), so the installation goes smoothly. When starting the application, Symbian OS checks the capability bit-mask of the EXE and assigns no capabilities to the application process, and trying to use any features beyond the basic ones will cause the KErrPermissionDenied exception.
    I added the flag --caps=0xff1b4 to my build script for ensymble and everything is working fine now.

    Thanks for your trouble kandyfloss. I do not have a dev cert at the moment so unlickily i can only test using open signed online.

Similar Threads

  1. Symbian Signed Security in 3rd edition
    By iulian_moldovan in forum Symbian
    Replies: 11
    Last Post: 2008-04-17, 06:14
  2. updating Symbian Signed application with a newer version
    By minstn in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 7
    Last Post: 2007-04-12, 11:33
  3. Symbian Signed --Backup & Recovry
    By bnvaikos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-03-02, 07:24
  4. Symbian Signed recognizer with self signed exe?
    By vonolsson in forum Symbian
    Replies: 2
    Last Post: 2007-02-23, 10:10
  5. Questions about Symbian Signed, Java Verified or Platform Security for Helin Risto
    By Nokia Ron in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2006-10-16, 16:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×