WebGate

Check-in [7ddd794862]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Base the default suspension key on user identity and working directory
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7ddd79486247a23fd6149122c985ecb84c8d7e88
User & Date: murphy 2013-05-30 18:10:52.691
Context
2013-05-31
12:21
Support for uri-safe or standard base64-encode check-in: 1b29946a75 user: murphy tags: trunk
2013-05-30
18:10
Base the default suspension key on user identity and working directory check-in: 7ddd794862 user: murphy tags: trunk
17:43
Improved encryption context cleanup code check-in: 63a4f6f079 user: murphy tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to webgate-suspend.scm.
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.

;;; Support for suspended computations

(define current-suspension-key
  (make-parameter
   (let ((ctx (create-context ALGO-SHA2)))
     (encrypt ctx (call-with-input-file "/proc/self/exe"
		    (cut read-string 8192 <>)))
     (encrypt ctx "")
     (let ((key (attribute/string ctx CTXINFO-HASHVALUE)))
       (destroy-object ctx)

       key))))

(define (wrap-suspension sk)
  (let ((evp (create-envelope FORMAT-CRYPTLIB)))
    (dynamic-wind
	void
	(lambda ()
	  (attribute-set! evp OPTION-ENCR-ALGO ALGO-AES)







<
<
|
<
<
<
>
|







23
24
25
26
27
28
29


30



31
32
33
34
35
36
37
38
39
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.

;;; Support for suspended computations

(define current-suspension-key
  (make-parameter


   (sprintf



    "~a:~a:~a"
    (current-user-id) (current-group-id) (current-directory))))

(define (wrap-suspension sk)
  (let ((evp (create-envelope FORMAT-CRYPTLIB)))
    (dynamic-wind
	void
	(lambda ()
	  (attribute-set! evp OPTION-ENCR-ALGO ALGO-AES)
Changes to webgate.scm.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.

(require-library
 srfi-1 srfi-4 srfi-13 srfi-14 srfi-18 srfi-69 srfi-99
 data-structures ports extras lolevel irregex tcp
 protobuf cryptlib)

(module suspension
  (with-limited-continuation 
   continuation-drop
   continuation-suspend
   continuation-resume) 







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.

(require-library
 srfi-1 srfi-4 srfi-13 srfi-14 srfi-18 srfi-69 srfi-99
 data-structures ports extras lolevel irregex tcp posix
 protobuf cryptlib)

(module suspension
  (with-limited-continuation 
   continuation-drop
   continuation-suspend
   continuation-resume) 
81
82
83
84
85
86
87
88

89
90
91
92
93
94
95
(module webgate-suspend
  (current-suspension-key
   suspended
   send/suspend)
  (import
   scheme chicken
   srfi-1 srfi-18 srfi-69
   extras suspension cryptlib webgate-utils webgate-core)

  (include
   "webgate-suspend.scm"))

(module webgate-cgi
  (cgi-main-loop)
  (import
   scheme chicken)







|
>







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(module webgate-suspend
  (current-suspension-key
   suspended
   send/suspend)
  (import
   scheme chicken
   srfi-1 srfi-18 srfi-69
   extras suspension cryptlib webgate-utils webgate-core
   (only posix current-user-id current-group-id current-directory))
  (include
   "webgate-suspend.scm"))

(module webgate-cgi
  (cgi-main-loop)
  (import
   scheme chicken)