Merge pull request #54 from LudovicRousseau/spy

Display the flags argument of C_Initialize()
Merge remote-tracking branch 'upstream/staging' into staging
Merge remote-tracking branch 'upstream/staging' into staging
Fix typo
More typo fixed
Fix compilation error on Mac OS X

In file included from pkcs15.c:30:
cardctl.h:870: error: expected specifier-qualifier-list before 'time_t'

Change-Id: I5faad5462ba6268fd7cf48a04f41e1755597ad0c
Merge pull request #80 from LudovicRousseau/staging

Fix typos in NEWS file
opensc-explorer: use standard usage() everywhere

With the improvements of the man page, there is no need any more to have
local help texts for functions.
opensc-explorer: convert CHANGE & UNBLOCK to sc_pin_cmd
opensc-explorer: allow entering the PIN interactively

In VERIFY, allow the user to enter the PIN unteractively if it was not given
on the command line, and if the card reader does not support PIN input.

If it was not given on the command line and the card reader supports PIN input,
then the bahaviour is unchanged: enter PIN via card reader.
opensc-explorer: increase allowed bytes in RANDOM

Allow to fetch up to 256 random bytes from the card -
236 being the maximal value for Le in short APDUs.
opensc-explorer: show text message for APDU result
opensc-explorer: warnings when compiling with Windows VC

opensc-explorer.c(447) : warning C4101: 'count' : unreferenced local variable
opensc-explorer.c(940) : warning C4013: 'strlcpy' undefined; assuming extern returning int
opensc-explorer.c(1683) : warning C4013: '_isatty' undefined; assuming extern returning int
opensc-explorer.c(1726) : warning C4090: 'function' : different 'const' qualifiers
opensc-explorer: allow longer PINs in CHANGE & UNBLOCK

Harmonize the allowed PIN length in CHANGE & UNBLOCK with the one in VERIFY,
making sure they are large enough for OpenPGP, which allows up ro 32 characters,
and giving additional security margin for other cards.
Only 9C key needs "Pin Always" i.e. user_consent

The 9D key does not nee the user_consent flag, as the PIV card only
enforces the "PIN Always" for the 9C signing key.

Various comments cleaned up.
Add pin_cache_ignore_user_consent parameter to opensc.conf

When OpenSC is used with a card that enforces user_consent
and the calling PKCS#11 application does not understand how
to handle the CKA_ALWAYS_AUTHENTICATE, signature operations
will fail.

OpenSC will not cache a PIN that protects a user_consent
object as one would expect.

This mods allows PINs to be cached even if protecting a
user_consent object by adding
 pin_cache_ignore_user_consent = true;
option in opensc.conf.

Thunderbird is the prime example of this situation.
Mozilla has accepted mods (357025 and 613507) to support
CKA_ALWAYS_AUTHENTICATE that will appear in NSS-3.14 but
this may be some time before this version is in vendor
distribution.
OpenPGP: Set write access more restrictive for pubkey blobs.

marschap: "The WRITE_ALWAYS ACL tells anyone can write to this file at any time."
pkcs11-tool: implement 'find mechanism from the given list'

and use it when testing signature
MyEID: always select in mode 'return FCI template'

According to ch.4.2 of MyEID reference manual v1.7.6 the only possible value of P2 of 'SELECT' APDU is '00'.
For this reason, when caller do not request to return 'sc_file' data,
use the non-null dummy 'sc_file' pointer in the call of iso->select_file,
and thus avoid the P2 different from '00'.

Also log calls are replaced by its short forms,
and resolved the 'trailing spaces' issues.
pkcs11: #439: 'SEQUENCE' of 'SET' issue when comparing cert attributes

Thanks to 'crank'.
https://www.opensc-project.org/opensc/ticket/439

Some pkcs11 callers (i.e. netscape) will pass in the ASN.1 encoded SEQUENCE OF SET,
while OpenSC just keeps the SET in the issuer/subject field.