Bug 863871, Part 3: Remove CVS keywords from generated code, r=wtc
--- a/lib/ckfw/builtins/certdata.perl
+++ b/lib/ckfw/builtins/certdata.perl
@@ -1,49 +1,32 @@
#!perl -w
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-my $cvs_id = '@(#) $RCSfile$ $Revision$ $Date$';
use strict;
my %constants;
my $count = 0;
my $o;
my @objects = ();
my @objsize;
-my $cvsid;
$constants{CKO_DATA} = "static const CK_OBJECT_CLASS cko_data = CKO_DATA;\n";
$constants{CK_TRUE} = "static const CK_BBOOL ck_true = CK_TRUE;\n";
$constants{CK_FALSE} = "static const CK_BBOOL ck_false = CK_FALSE;\n";
while(<>) {
my @fields = ();
my $size;
s/^((?:[^"#]+|"[^"]*")*)(\s*#.*$)/$1/;
next if (/^\s*$/);
- if( /(^CVS_ID\s+)(.*)/ ) {
- $cvsid = $2 . "\"; $cvs_id\"";
- my $scratch = $cvsid;
- $size = 1 + $scratch =~ s/[^"\n]//g;
- @{$objects[0][0]} = ( "CKA_CLASS", "&cko_data", "sizeof(CK_OBJECT_CLASS)" );
- @{$objects[0][1]} = ( "CKA_TOKEN", "&ck_true", "sizeof(CK_BBOOL)" );
- @{$objects[0][2]} = ( "CKA_PRIVATE", "&ck_false", "sizeof(CK_BBOOL)" );
- @{$objects[0][3]} = ( "CKA_MODIFIABLE", "&ck_false", "sizeof(CK_BBOOL)" );
- @{$objects[0][4]} = ( "CKA_LABEL", "\"CVS ID\"", "7" );
- @{$objects[0][5]} = ( "CKA_APPLICATION", "\"NSS\"", "4" );
- @{$objects[0][6]} = ( "CKA_VALUE", $cvsid, "$size" );
- $objsize[0] = 7;
- next;
- }
-
# This was taken from the perl faq #4.
my $text = $_;
push(@fields, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)"\s? # groups the phrase inside the quotes
| ([^\s]+)\s?
| \s
}gx;
push(@fields, undef) if substr($text,-1,1) eq '\s';
@@ -105,17 +88,17 @@ while(<>) {
# print "$fields[0] | $fields[1] | $size | $fields[2]\n";
}
doprint();
sub dudump {
my $i;
-for( $i = 0; $i <= $count; $i++ ) {
+for( $i = 1; $i <= $count; $i++ ) {
print "\n";
$o = $objects[$i];
my @ob = @{$o};
my $l;
my $j;
for( $j = 0; $j < @ob; $j++ ) {
$l = $ob[$j];
my @a = @{$l};
@@ -128,104 +111,71 @@ for( $i = 0; $i <= $count; $i++ ) {
sub doprint {
my $i;
print <<EOD
/* THIS IS A GENERATED FILE */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifdef DEBUG
-static const char CVS_ID[] = $cvsid;
-#endif /* DEBUG */
#ifndef BUILTINS_H
#include "builtins.h"
#endif /* BUILTINS_H */
EOD
;
foreach $b (sort values(%constants)) {
print $b;
}
-for( $i = 0; $i <= $count; $i++ ) {
- if( 0 == $i ) {
- print "#ifdef DEBUG\n";
- }
-
+for( $i = 1; $i <= $count; $i++ ) {
print "static const CK_ATTRIBUTE_TYPE nss_builtins_types_$i [] = {\n";
$o = $objects[$i];
my @ob = @{$o};
my $j;
for( $j = 0; $j < @ob; $j++ ) {
my $l = $ob[$j];
my @a = @{$l};
print " $a[0]";
if( $j+1 != @ob ) {
print ", ";
}
}
print "\n};\n";
-
- if( 0 == $i ) {
- print "#endif /* DEBUG */\n";
- }
}
-for( $i = 0; $i <= $count; $i++ ) {
- if( 0 == $i ) {
- print "#ifdef DEBUG\n";
- }
-
+for( $i = 1; $i <= $count; $i++ ) {
print "static const NSSItem nss_builtins_items_$i [] = {\n";
$o = $objects[$i];
my @ob = @{$o};
my $j;
for( $j = 0; $j < @ob; $j++ ) {
my $l = $ob[$j];
my @a = @{$l};
print " { (void *)$a[1], (PRUint32)$a[2] }";
if( $j+1 != @ob ) {
print ",\n";
} else {
print "\n";
}
}
print "};\n";
-
- if( 0 == $i ) {
- print "#endif /* DEBUG */\n";
- }
}
print "\nbuiltinsInternalObject\n";
print "nss_builtins_data[] = {\n";
-for( $i = 0; $i <= $count; $i++ ) {
-
- if( 0 == $i ) {
- print "#ifdef DEBUG\n";
- }
-
+for( $i = 1; $i <= $count; $i++ ) {
print " { $objsize[$i], nss_builtins_types_$i, nss_builtins_items_$i, {NULL} }";
-
if( $i == $count ) {
print "\n";
} else {
print ",\n";
}
-
- if( 0 == $i ) {
- print "#endif /* DEBUG */\n";
- }
}
print "};\n";
print "const PRUint32\n";
-print "#ifdef DEBUG\n";
-print " nss_builtins_nObjects = $count+1;\n";
-print "#else\n";
-print " nss_builtins_nObjects = $count;\n";
-print "#endif /* DEBUG */\n";
+print "nss_builtins_nObjects = $count;\n";
}
--- a/lib/ckfw/builtins/certdata.txt
+++ b/lib/ckfw/builtins/certdata.txt
@@ -1,13 +1,12 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-CVS_ID "@(#) $RCSfile$ $Revision$ $Date$"
#
# certdata.txt
#
# This file contains the object definitions for the certs and other
# information "built into" NSS.
#
# Object definitions:
--- a/lib/ckfw/ck.api
+++ b/lib/ckfw/ck.api
@@ -1,18 +1,16 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This file is in part derived from a file "pkcs11f.h" made available
# by RSA Security at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/pkcs11f.h
-CVS_ID "@(#) $RCSfile$ $Revision$ $Date$"
-
# Fields
# FUNCTION introduces a Cryptoki function
# CK_type specifies and introduces an argument
#
# General-purpose
# C_Initialize initializes the Cryptoki library.
--- a/lib/ckfw/ckapi.perl
+++ b/lib/ckfw/ckapi.perl
@@ -69,20 +69,16 @@ open(API, ">nssck.api") || die "Can't op
select PROTOTYPE;
print $copyright;
print <<EOD
#ifndef NSSCKG_H
#define NSSCKG_H
-#ifdef DEBUG
-static const char NSSCKG_CVS_ID[] = "$g{CVS_ID} ; $cvs_id";
-#endif /* DEBUG */
-
/*
* nssckg.h
*
* This automatically-generated header file prototypes the Cryptoki
* functions specified by PKCS#11.
*/
#ifndef NSSCKT_H
@@ -113,20 +109,16 @@ EOD
select TYPEDEF;
print $copyright;
print <<EOD
#ifndef NSSCKFT_H
#define NSSCKFT_H
-#ifdef DEBUG
-static const char NSSCKFT_CVS_ID[] = "$g{CVS_ID} ; $cvs_id";
-#endif /* DEBUG */
-
/*
* nssckft.h
*
* The automatically-generated header file declares a typedef
* each of the Cryptoki functions specified by PKCS#11.
*/
#ifndef NSSCKT_H
@@ -157,20 +149,16 @@ EOD
select EPV;
print $copyright;
print <<EOD
#ifndef NSSCKEPV_H
#define NSSCKEPV_H
-#ifdef DEBUG
-static const char NSSCKEPV_CVS_ID[] = "$g{CVS_ID} ; $cvs_id";
-#endif /* DEBUG */
-
/*
* nssckepv.h
*
* This automatically-generated header file defines the type
* CK_FUNCTION_LIST specified by PKCS#11.
*/
#ifndef NSSCKT_H
@@ -201,20 +189,16 @@ print <<EOD
EOD
;
select API;
print $copyright;
print <<EOD
-#ifdef DEBUG
-static const char NSSCKAPI_CVS_ID[] = "$g{CVS_ID} ; $cvs_id";
-#endif /* DEBUG */
-
/*
* nssck.api
*
* This automatically-generated file is used to generate a set of
* Cryptoki entry points within the object space of a Module using
* the NSS Cryptoki Framework.
*
* The Module should have a .c file with the following: