#! /usr/bin/tclsh
# This file is part of secnet.
# See LICENCE and this file CREDITS for full list of copyright holders.
# SPDX-License-Identifier: GPL-3.0-or-later
# There is NO WARRANTY.

source stest/common.tcl

# `non-negotiating' ends:
set privkey(inside) {load-private rsa1 test-example/inside.key}
set privkey(outside) {load-private rsa1 test-example/outside.key}
# So old, old; ie -oo

# There is no -no because the sites file tells a new inside to expect
# a different key.

proc sitesconf_hook {l} {
    global builddir
    # Use `make-public' verb, so we have a test case for it
    if {[regexp {^(.* key )rsa-public\("(\d+)","(\d+)"\)(;.*)$} \
	     $l dummy lhs rsa_e rsa_n rhs]} {
	set b91 [exec $builddir/base91s/base91s -w0 << "42 $rsa_e $rsa_n"]
	set l "${lhs}make-public(\"rsa1\",\"$b91\")${rhs}"
    }
    return $l
}

test-kex
