Last Comment Bug 113323 - The first argument to PK11_FindCertFromNickname should be const.
: The first argument to PK11_FindCertFromNickname should be const.
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: 3.3.1
: All All
: P2 normal (vote)
: 3.12
Assigned To: Julien Pierre
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-03 13:48 PST by Wan-Teh Chang
Modified: 2007-07-10 21:48 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Constify named functions and their dependencies (23.22 KB, patch)
2007-07-10 18:41 PDT, Julien Pierre
nelson: review+
Details | Diff | Splinter Review

Description Wan-Teh Chang 2001-12-03 13:48:33 PST
The function PK11_FindCertFromNickname is declared in pk11func.h as
CERTCertificate * PK11_FindCertFromNickname(char *nickname, void *wincx);

The first argument 'nickname' should be a const char *.
Comment 1 Wan-Teh Chang 2001-12-19 12:09:19 PST
Target 4.0, priority P1.
Comment 2 Kai Engert (:kaie) 2002-01-14 20:27:37 PST
More candidates:
  CERT_FindCertByNickname (parameter 2)
  CERT_FindUserCertByUsage (parameter 2)
  PK11_CheckUserPassword (parameter 2)
  PK11_InitPin (parameters 2 and 3)
  PK11_ChangePW (parameters 2 and 3)
  PK11_FindSlotByName (parameter 1)
  SECMOD_FindModule (parameter 1)
Comment 3 Wan-Teh Chang 2002-04-25 16:13:08 PDT
Changed the QA contact to Bishakha.
Comment 4 Julien Pierre 2005-11-15 18:56:07 PST
This is not P1 . Moving from non-const to const argument doesn't break either binary or source compatibility, so it doesn't need to wait for 4.0 . Resetting target to "---" .
Comment 5 Julien Pierre 2007-07-10 18:41:26 PDT
Created attachment 271780 [details] [diff] [review]
Constify named functions and their dependencies
Comment 6 Nelson Bolyard (seldom reads bugmail) 2007-07-10 20:55:02 PDT
Comment on attachment 271780 [details] [diff] [review]
Constify named functions and their dependencies

r=nelson after one change is made:

I think the following change was a mistake.  Undo that, and then r=nelson.

> /*
>  * Given a cert, find the cert with the same subject name that
>  * has the given key usage.  If the given cert has the correct keyUsage, then
>  * return it, otherwise search the list in order.
>  */
> CERTCertificate *
>-CERT_FindCertByUsage(CERTCertificate *basecert, unsigned int requiredKeyUsage);
>+CERT_FindCertByUsage(CERTCertificate *basecert,
>+                     const unsigned int requiredKeyUsage);
Comment 7 Julien Pierre 2007-07-10 21:48:30 PDT
Good catch, Nelson .
Actually, it turns out that CERT_FindCertByUsage doesn't have any implementation anywhere in lib ! It was just a dead declaration in cert.h . So, I have removed it.

This was checked in to the trunk :

Checking in certdb/cert.h;
/cvsroot/mozilla/security/nss/lib/certdb/cert.h,v  <--  cert.h
new revision: 1.58; previous revision: 1.57
done
Checking in certdb/certdb.c;
/cvsroot/mozilla/security/nss/lib/certdb/certdb.c,v  <--  certdb.c
new revision: 1.79; previous revision: 1.78
done
Checking in certdb/stanpcertdb.c;
/cvsroot/mozilla/security/nss/lib/certdb/stanpcertdb.c,v  <--  stanpcertdb.c
new revision: 1.74; previous revision: 1.73
done
Checking in certhigh/certhigh.c;
/cvsroot/mozilla/security/nss/lib/certhigh/certhigh.c,v  <--  certhigh.c
new revision: 1.40; previous revision: 1.39
done
Checking in dev/dev.h;
/cvsroot/mozilla/security/nss/lib/dev/dev.h,v  <--  dev.h
new revision: 1.38; previous revision: 1.37
done
Checking in dev/devtoken.c;
/cvsroot/mozilla/security/nss/lib/dev/devtoken.c,v  <--  devtoken.c
new revision: 1.40; previous revision: 1.39
done
Checking in pk11wrap/pk11auth.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11auth.c,v  <--  pk11auth.c
new revision: 1.7; previous revision: 1.6
done
Checking in pk11wrap/pk11cert.c;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v  <--  pk11cert.c
new revision: 1.156; previous revision: 1.155
done
Checking in pk11wrap/pk11pub.h;
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11pub.h,v  <--  pk11pub.h
new revision: 1.18; previous revision: 1.17
done
Checking in pki/cryptocontext.c;
/cvsroot/mozilla/security/nss/lib/pki/cryptocontext.c,v  <--  cryptocontext.c
new revision: 1.17; previous revision: 1.16
done
Checking in pki/nsspki.h;
/cvsroot/mozilla/security/nss/lib/pki/nsspki.h,v  <--  nsspki.h
new revision: 1.12; previous revision: 1.11
done
Checking in pki/pkim.h;
/cvsroot/mozilla/security/nss/lib/pki/pkim.h,v  <--  pkim.h
new revision: 1.29; previous revision: 1.28
done
Checking in pki/pkistore.c;
/cvsroot/mozilla/security/nss/lib/pki/pkistore.c,v  <--  pkistore.c
new revision: 1.29; previous revision: 1.28
done
Checking in pki/pkistore.h;
/cvsroot/mozilla/security/nss/lib/pki/pkistore.h,v  <--  pkistore.h
new revision: 1.11; previous revision: 1.10
done
Checking in pki/tdcache.c;
/cvsroot/mozilla/security/nss/lib/pki/tdcache.c,v  <--  tdcache.c
new revision: 1.46; previous revision: 1.45
done
Checking in pki/trustdomain.c;
/cvsroot/mozilla/security/nss/lib/pki/trustdomain.c,v  <--  trustdomain.c
new revision: 1.54; previous revision: 1.53
done

Note You need to log in before you can comment on or make changes to this bug.