aboutsummaryrefslogtreecommitdiff
path: root/openssl/agent/pkcs11/url.test.testscript
blob: 807fad9f06663ecade5216ee99a5ca04fc7dfa3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# file      : openssl/agent/pkcs11/url.test.testscript -*- C++ -*-
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

: valid
:
$* <<EOF >>EOF
pkcs11:token=unused;object=SIGN%20key
pkcs11:token=unused;object=SIGN%20key?pin-value=123123
pkcs11:
pkcs11:?pin=123123
pkcs11:library-version=1.2
pkcs11:?module-path=/usr/lib
pkcs11:id=%01%00%38%02;token=unused
pkcs11:?a=b
EOF

: invalid
:
{
  $* <'file:/abc'      2>'invalid scheme'          != 0 : invalid-scheme
  $* <'pkcs11:/abc'    2>'one-level path expected' != 0 : root
  $* <'pkcs11:a/bc'    2>'one-level path expected' != 0 : multi-level
  $* <'pkcs11://a/abc' 2>'unexpected authority'    != 0 : authority
  $* <'pkcs11:abc#x'   2>'unexpected fragment'     != 0 : fragment

  $* <'pkcs11:slot-id=a' 2>"invalid slot-id attribute value 'a'"!= 0 : slot-id

  $* <'pkcs11:a=b' 2>"unknown attribute 'a'" != 0 : unknown-ident

  : lib-min-ver
  :
  $* <'pkcs11:library-version=1.a' 2>"invalid library minor version 'a'" != 0
}