Check-in [2d57dd9864]
Overview
Comment:Make Tcl SSH Agent more standalone
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d57dd9864e513ac1cee6d64a5f969b1d224c00b
User & Date: rkeene on 2022-03-13 20:46:34
Other Links: manifest | tags
Context
2024-02-27
18:31
Create new branch named "ssh-agent-encode-bigint-better" Leaf check-in: bae07d7e7c user: rkeene tags: ssh-agent-encode-bigint-better
2022-03-13
20:46
Make Tcl SSH Agent more standalone Leaf check-in: 2d57dd9864 user: rkeene tags: trunk
20:23
Add SHA-512 support (hacked) and a bit of cleanup check-in: a1b40a439c user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [4e7947b3ab] to [5381eee219].

37
38
39
40
41
42
43

build/chrome/test
build/chrome/google-pcsc.js
build/chrome/manifest.json
build/chrome/jsrsasign.js
build/chrome/extra/*.png
build/tcl/ssh-agent-noasync.js
build/tcl/tclkit








>
37
38
39
40
41
42
43
44
build/chrome/test
build/chrome/google-pcsc.js
build/chrome/manifest.json
build/chrome/jsrsasign.js
build/chrome/extra/*.png
build/tcl/ssh-agent-noasync.js
build/tcl/tclkit
build/tcl/ssh-agent

Modified build/tcl/Makefile from [ef0ac61411] to [f52d795173].

1






2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
all: ssh-agent-noasync.js







ssh-agent-noasync.js: ../chrome/ssh-agent.js
	$(CC) -Dawait='' -Dasync='' -nostdinc -C -E -x c ../chrome/ssh-agent.js -o - | grep -v '^# ' > ssh-agent-noasync.js.new
	mv ssh-agent-noasync.js.new ssh-agent-noasync.js

softokn3-pkcs11.so: softokn3-pkcs11.c
	$(CC) -fPIC -Wall -shared -o softokn3-pkcs11.so softokn3-pkcs11.c

clean:
	rm -f ssh-agent-noasync.js.new ssh-agent-noasync.js
	rm -f softokn3-pkcs11.so


distclean: clean

.PHONY: all clean distclean
|
>
>
>
>
>
>











>




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
all: ssh-agent

ssh-agent: ssh-agent.in ssh-agent-noasync.js chrome-emu.js
	rm -f ssh-agent.new ssh-agent
	sed $$'/@@SSH_AGENT_NOASYNC_JS@@/{r ssh-agent-noasync.js\nd}\n/@@CHROME_EMU_JS@@/{r chrome-emu.js\nd}' < ssh-agent.in > ssh-agent.new
	chmod +x ssh-agent.new
	mv ssh-agent.new ssh-agent

ssh-agent-noasync.js: ../chrome/ssh-agent.js
	$(CC) -Dawait='' -Dasync='' -nostdinc -C -E -x c ../chrome/ssh-agent.js -o - | grep -v '^# ' > ssh-agent-noasync.js.new
	mv ssh-agent-noasync.js.new ssh-agent-noasync.js

softokn3-pkcs11.so: softokn3-pkcs11.c
	$(CC) -fPIC -Wall -shared -o softokn3-pkcs11.so softokn3-pkcs11.c

clean:
	rm -f ssh-agent-noasync.js.new ssh-agent-noasync.js
	rm -f softokn3-pkcs11.so
	rm -f ssh-agent.new ssh-agent

distclean: clean

.PHONY: all clean distclean

Modified build/tcl/ssh-agent.in from [bf92e80fb2] to [973f5211fa].

16
17
18
19
20
21
22









23
24
25
26
27
28
29
	error "Must set SSH_AGENT_PKCS11_MODULE"
}

package require duktape 0.7
package require tuapi
package require pki 0.6
package require pki::pkcs11 0.9.9










## HACK: Fix up older versions of "pki" to include the raw certificate
##       this is needed
apply {{} {
	set procToUpdate ::pki::x509::parse_cert
	if {![string match "*set ret(raw)*" [info body $procToUpdate]]} {
		set body [info body $procToUpdate]







>
>
>
>
>
>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
	error "Must set SSH_AGENT_PKCS11_MODULE"
}

package require duktape 0.7
package require tuapi
package require pki 0.6
package require pki::pkcs11 0.9.9

# Files
set ::files(chrome-emu.js) {
@@CHROME_EMU_JS@@
}

set ::files(ssh-agent-noasync.js) {
@@SSH_AGENT_NOASYNC_JS@@
}

## HACK: Fix up older versions of "pki" to include the raw certificate
##       this is needed
apply {{} {
	set procToUpdate ::pki::x509::parse_cert
	if {![string match "*set ret(raw)*" [info body $procToUpdate]]} {
		set body [info body $procToUpdate]
152
153
154
155
156
157
158







159
160
161
162
163
164
165
		}
		X509.parseCert = __parseCert;
		delete __parseCert;
	}
}

proc readFile {fileName} {







	set fileName [file join $::dir $fileName]
	if {![info exists ::readFile($fileName)]} {
		catch {
			set fd [open $fileName]
			set ::readFile($fileName) [read $fd]
		}
		catch {







>
>
>
>
>
>
>







161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
		}
		X509.parseCert = __parseCert;
		delete __parseCert;
	}
}

proc readFile {fileName} {
	if {[info exists ::files($fileName)]} {
		set data $::files($fileName)
		if {[string range [string trim $data] 0 1] ne "@@"} {
			return $data
		}
	}

	set fileName [file join $::dir $fileName]
	if {![info exists ::readFile($fileName)]} {
		catch {
			set fd [open $fileName]
			set ::readFile($fileName) [read $fd]
		}
		catch {