From a31735dcee7258bfa479950bccd356c68b83d631 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 26 Oct 2008 17:15:01 -0400 Subject: [PATCH] Add a script to regenerate the VNC client's certificate store svn path=/trunk/packages/invirt-vnc-client/; revision=1336 --- Makefile | 4 +--- debian/changelog | 3 ++- debian/invirt-update-vnc-cert.sh | 18 ++++++++++++++++ debian/invirt-vnc-client.dirs | 1 + debian/invirt-vnc-client.install | 1 + debian/invirt-vnc-client.postinst | 42 +++++++++++++++++++++++++++++++++++++ trust.store | Bin 1069 -> 0 bytes 7 files changed, 65 insertions(+), 4 deletions(-) create mode 100755 debian/invirt-update-vnc-cert.sh create mode 100644 debian/invirt-vnc-client.install create mode 100644 debian/invirt-vnc-client.postinst delete mode 100644 trust.store diff --git a/Makefile b/Makefile index 30654a7..259ee2c 100644 --- a/Makefile +++ b/Makefile @@ -33,15 +33,13 @@ SOURCES = VncViewer.java RfbProto.java AuthPanel.java VncCanvas.java \ InStream.java MemInStream.java ZlibInStream.java \ VNCProxyConnectSocketWrapper.java SocketWrapper.java InvirtTrustManager.java -EXTRAJAR = trust.store - all: $(CLASSES) $(ARCHIVE) $(CLASSES): $(SOURCES) $(JC) $(JCFLAGS) -O $(SOURCES) $(ARCHIVE): $(CLASSES) $(MANIFEST) - $(JAR) cfm $(ARCHIVE) $(MANIFEST) $(CLASSES) $(EXTRAJAR) + $(JAR) cfm $(ARCHIVE) $(MANIFEST) $(CLASSES) install: $(CLASSES) $(ARCHIVE) $(CP) $(CLASSES) $(ARCHIVE) $(PAGES) $(INSTALL_DIR) diff --git a/debian/changelog b/debian/changelog index c799420..8b0bd05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ invirt-vnc-client (0.0.1) unstable; urgency=low * sipb-xen-vnc-client -> invirt-vnc-client * SIPBTrustManager -> InvirtTrustManager + * Add a script to regenerate the client's certificate store - -- Evan Broder Sun, 26 Oct 2008 16:05:14 -0400 + -- Evan Broder Sun, 26 Oct 2008 17:14:15 -0400 sipb-xen-vnc-client (1.03) unstable; urgency=low diff --git a/debian/invirt-update-vnc-cert.sh b/debian/invirt-update-vnc-cert.sh new file mode 100755 index 0000000..fa73f27 --- /dev/null +++ b/debian/invirt-update-vnc-cert.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ "$(ls /etc/invirt/vnc-cert.d)" == "" ]; then + echo "E: No certs in /etc/invirt/vnc-cert.d/" >&2 + echo " Put certificates for all Invirt VNC proxy servers in" >&2 + echo " /etc/invirt/vnc-cert.d, then run this script again" >&2 + exit 1 +fi + +TMP_DIR="$(mktemp -d)" +for i in $(ls /etc/invirt/vnc-cert.d/*.crt); do + keytool -noprompt -alias "${i%.crt}" -file "/etc/invirt/vnc-cert.d/$i" \ + -keystore "$TMP_DIR/trust.store" -storepass "foobar" +done + +jar uf /usr/share/invirt-vnc-client/VncViewer.jar -C "$TMP_DIR" trust.store + +rm -rf "$TMP_DIR" diff --git a/debian/invirt-vnc-client.dirs b/debian/invirt-vnc-client.dirs index 65f18e7..e80759d 100644 --- a/debian/invirt-vnc-client.dirs +++ b/debian/invirt-vnc-client.dirs @@ -1 +1,2 @@ +etc/invirt/vnc-cert.d usr/share/invirt-vnc-client diff --git a/debian/invirt-vnc-client.install b/debian/invirt-vnc-client.install new file mode 100644 index 0000000..0f6411b --- /dev/null +++ b/debian/invirt-vnc-client.install @@ -0,0 +1 @@ +debian/invirt-update-vnc-cert.sh usr/sbin/invirt-update-vnc-cert diff --git a/debian/invirt-vnc-client.postinst b/debian/invirt-vnc-client.postinst new file mode 100644 index 0000000..6fede0c --- /dev/null +++ b/debian/invirt-vnc-client.postinst @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + invirt-update-vnc-cert || true + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/trust.store b/trust.store deleted file mode 100644 index 83e925795dee02dc4dd76c596cac2579ebaf919a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1069 zcmezO_TO6u1_mY|W(3o$xs}T9JU5weqouP)i zJhy&yUcM$>`)^R4&?@a99c$nBe|Pj43UICL;=Xn|z1N)Sh&~JZrCKlh=A+*1EJYFr zwi@4@%f!scz__@H(aE5R(GD2;%%QS;EMhDop-G14tDSG%IuM+EZPzBN=G_+T96%+! zAO*@SO^hr+4nqT0WeXecENQ$sY@?zHDckXYfC#VSKR>IySl_VF jbk)OG$-bxhw3#QbIZ<-!&&o&7_T4;p>(MmsNLCvFSFuZ! -- 1.7.9.5