setpk11provider.pl revision 247bf378605811d695e968dbe930a7fc45c0038e
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * copyright notice and this permission notice appear in all copies.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This script sets the PKCS#11 provider name in the build scripts.
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer# for instance: setpk11provider.pl bp201w32HSM
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayerif ($#ARGV != 0) {
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews die "Usage: perl setpk11provider.pl <pkcs11_provider_dll_name>\n"
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer# List of files that need to be updated
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews@filelist = ("../bin/pkcs11/win32//pk11keygen.mak",
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "../bin/pkcs11/win32//pk11keygen.dsp",
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "../bin/pkcs11/win32//pk11list.mak",
68c2ccc953059f389cefc0f8a5ce0f83be7458c9Danny Mayer "../bin/pkcs11/win32//pk11list.dsp",
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "../bin/pkcs11/win32//pk11destroy.mak",
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews "../bin/pkcs11/win32//pk11destroy.dsp");
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# function to replace the provider define
1e369379766496d6088982a8e29679efa98d7df9Danny Mayer open (RFILE, $filename) || die "Can't open file $filename: $!";
close (RFILE);
close(RFILE);
sub updateconfig {
my(@Lines);
close (RFILE);
if ($havexml) {
close(RFILE);
$ind++;