Viewing File: /usr/local/cpanel/3rdparty/mailman/Mailman/CSRFcheck.pyc
ó
)¿Úhc @ sÀ d Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m
Z
m Z i e j d 6e j
d 6e j d 6e j d 6e j d
6Z d d „ Z d d „ Z d S(
s$ Cross-Site Request Forgery checker iÿÿÿÿN( t mm_cfg( t syslog( t UnobscureEmailt sha_newt usert postert moderatort admint sitec
C s¶ | r t t j | ƒ ƒ } n x: | D]. } | j | | ƒ \ } } | r% | r% Pq% q% Wd St t j ƒ ƒ } t | |
ƒ j ƒ } d | | f } t j
t j | | f ƒ ƒ } | S( s5 create token by mailman cookie generation algorithm s %s:%sN(
R t urllibt unquotet AuthContextInfot Nonet intt timeR t hexdigestt binasciit hexlifyt marshalt dumps(
t mlistt contextsR t contextt keyt secrett issuedt mact keymact token( ( s7 /usr/local/cpanel/3rdparty/mailman/Mailman/CSRFcheck.pyt
csrf_token' s
c C s yşt j t j | ƒ ƒ \ } } | j d d ƒ \ } } | j | j ƒ d ƒ sV t S| t | j ƒ ƒ d } d | k r— | j d d ƒ \ } } n d
} | d k rà | d k r#t
d d | rÒ | d | n | ƒ t SnC | d k r#| d k r#t
d d
| r| d | n | ƒ t Sn | rvt t j
| ƒ ƒ } | rv| j ƒ | j ƒ k rvt
d d | | ƒ t Sn t j | ƒ } | j | | ƒ \ } }
| s©t ‚ t |
|
ƒ j ƒ } | | k rùd t j ƒ | k oğt j k n rùt St SWn t t t f k
rt SXd
S( s4 check token by mailman cookie validation algorithm t :i t +R R t mischiefs3 admin form submitted with CSRF token issued for %s.t admindbR s5 admindb form submitted with CSRF token issued for %s.s9 Form for user %s submitted with CSRF token issued for %s.i N( s admins site( s moderators admins site( R t loadsR t unhexlifyt splitt
startswitht
internal_namet Falset lenR R R R R
t lowert keydictt getR t AssertionErrorR R R R t
FORM_LIFETIMEt Truet
ValueErrort TypeError( R R t cgi_userR R R t received_macR t raw_userR R R ( ( s7 /usr/local/cpanel/3rdparty/mailman/Mailman/CSRFcheck.pyt
csrf_check: sL
)( t __doc__R R R R t MailmanR t Mailman.Logging.SyslogR t
Mailman.UtilsR R t AuthUsert AuthListPostert AuthListModeratort
AuthListAdmint
AuthSiteAdminR* R R R4 ( ( ( s7 /usr/local/cpanel/3rdparty/mailman/Mailman/CSRFcheck.pyt <module> s
Back to Directory
File Manager