cryptomgmtlibs/securitytestfw/test/autotesting/checklocationofcertificates.pl
changeset 8 35751d3474b7
parent 0 2c201484c85f
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
     1 #
     1 #
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     3 # All rights reserved.
     4 # This component and the accompanying materials are made available
     4 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     5 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     6 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
    10 # Nokia Corporation - initial contribution.
    10 # Nokia Corporation - initial contribution.
    11 #
    11 #
    12 # Contributors:
    12 # Contributors:
    13 #
    13 #
    14 # Description: 
    14 # Description: 
    15 #
       
    16 # This script was written as part the solution for DEF116697: Remove Security Test Certificates from CBR 
    15 # This script was written as part the solution for DEF116697: Remove Security Test Certificates from CBR 
    17 # The purpose of the defect was to stop the export of all test certificates that may not be Symbian owned.
    16 # The purpose of the defect was to stop the export of all test certificates that may not be Symbian owned.
    18 # To accomplish this the certificates were all moved to a new location which does not get put in the CBR.
    17 # To accomplish this the certificates were all moved to a new location which does not get put in the CBR.
    19 # This script is run in the ONB so that no new certificates are added to any directory that appears in the CBR.
    18 # This script is run in the ONB so that no new certificates are added to any directory that appears in the CBR.
    20 # (Note that the certificates in rootcerts are Symbian owned and so can be exported.)
    19 # (Note that the certificates in rootcerts are Symbian owned and so can be exported.)
    21 
       
    22 
       
    23 # This script takes 2 arguments
    20 # This script takes 2 arguments
    24 # - directory to search for certificates (defaults to \common\generic\security)
    21 # - directory to search for certificates (defaults to \common\generic\security)
    25 # - output file for result of test (defaults to $ENV{EPOCROOT}epoc32\\winscw\\c\\CheckLocationOfCertificatesLog.txt)
    22 # - output file for result of test (defaults to $ENV{EPOCROOT}epoc32\\winscw\\c\\CheckLocationOfCertificatesLog.txt)
    26 # The script searches through the specified directory for any certificate files (files ending in .cer, .der and .crt).
    23 # The script searches through the specified directory for any certificate files (files ending in .cer, .der and .crt).
    27 # It will print out the names of any files found. 
    24 # It will print out the names of any files found. 
       
    25 #
    28  
    26  
    29 
    27 
    30 use File::Find;
    28 use File::Find;
    31 
    29 
    32 # array holding the list of full path names to all the certificates found.
    30 # array holding the list of full path names to all the certificates found.
    34  
    32  
    35  
    33  
    36 sub FindCerts
    34 sub FindCerts
    37 {
    35 {
    38 	# Check for certificates which are not in valid locations 
    36 	# Check for certificates which are not in valid locations 
    39 	if (($File::Find::dir !~ m/\/testframework\/testcertificates/) && ($File::Find::dir !~ m/\/os\/security\/cryptoservices\/rootcertificates/))
    37 	if (($File::Find::dir !~ m/\/testframework\/testcertificates/) && ($File::Find::dir !~ m/\/os\/security\/cryptoservices\/rootcertificates/) && ($File::Find::dir !~ m/\/os\/security\/cryptomgmtlibs\/securitytestfw\/testcertificates/))
    40 	{	
    38 	{	
    41 		if ($File::Find::name =~ m/\.cer$/i)
    39 		if ($File::Find::name =~ m/\.cer$/i)
    42 		{
    40 		{
    43 			push @Certificates, $File::Find::name;	 
    41 			push @Certificates, $File::Find::name;	 
    44 		}
    42 		}