1
# Copyright (C) 2007, One Laptop Per Child
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
from xpcom import components
21
from xpcom.components import interfaces
22
from xpcom.server.factory import Factory
24
class SecurityDialogs:
25
_com_interfaces_ = interfaces.nsIBadCertListener
27
cid = '{267d2fc2-1810-11dc-8314-0800200c9a66}'
28
description = 'Sugar Security Dialogs'
33
def confirmCertExpired(socketInfo, cert):
34
logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmCertExpired()')
35
return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
37
def confirmMismatchDomain(socketInfo, targetURL, cert):
38
logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmMismatchDomain()')
39
return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
41
def confirmUnknownIssuer(socketInfo, cert, certAddType):
42
logging.debug('UNIMPLEMENTED: SecurityDialogs.confirmUnknownIssuer()')
43
return interfaces.nsIBadCertListener.ADD_TRUSTED_FOR_SESSION, True
45
def notifyCrlNextupdate(socketInfo, targetURL, cert):
46
logging.debug('UNIMPLEMENTED: SecurityDialogs.notifyCrlNextupdate()')
49
components.registrar.registerFactory(SecurityDialogs.cid,
50
SecurityDialogs.description,
51
'@mozilla.org/nsBadCertListener;1',
52
Factory(SecurityDialogs))