esteid: Do not set CKA_ALWAYS_AUTHENTICATE for the "Allkirjastamine" key

CKA_ALWAYS_AUTHENTICATE implies CKU_CONTEXT_SPECIFIC login, but all this
key really should need is a C_Login with CKU_USER.

The historical reason for having CKA_ALWAYS_AUTHENTICATE set was to keep
Firefox/NSS from using that particular key for SSL connections. However,
starting with Firefox 8, NSS ignores Non Repudiation certificates for
SSL and that makes the CKA_ALWAYS_AUTHENTICATE workaround unnecessary.

Now that Firefox is fixed, drop the workaround in OpenSC so that
applications that follow the pkcs11 spec wouldn't have to login twice to
access the key.
piv-tool -s not sending APDU - missing code

The code to send the APDU to the piv card when using
piv-tool -s xx:xx:xx... was inadvertently removed
on 2011-04-26 02:29:53 by: 1cdb3fa9716bf287387020f06892a5f45cde98fc
APDU parsing: switch to Frank Morgner's implementation

The missing code is replaced.

The -s option is infrequently used, so the problem
was not spotted earlier.
Add pkcs15init-binding for OpenPGP
PKCS15-OpenPGP: Change the way emu_init return in error case.
OpenPGP: Correct the way to set output after generating key.

Correct the way to parse response data.
Updated wrong blob for pubkey info <~~ Fix.

OpenPGP: Store creation time after generating keys.

OpenPGP: Put_data: Handle the case that DO exists but its blob does not.
When checking DO before writing, relying on blobs only will miss the case that DO exists but its blob does not, when DO is non-readable.

OpenPGP: Set algorithm attributes before generating key.

OpenPGP: Add dependency of OpenSSL.

OpenPGP: Calculate and store fingerprint.
Calculate and store fingerprint after generating key.

OpenPGP: Update blob of pubkey info.
Update blob holding pubkey info after generating key.

OpenPGP: Add step to update card algorithms.
Update card algorithms after generating key. However, this step is not implemented yet, because of suspection about wrong data (see code comment).
openpgp-tool: Key generation support.

openpgp-tool: PIN verfication support.
openpgp-tool: Add notification in case of error.
openpgp-tool: Add manual for key generation and PIN verification.
OpenPGP: Add support for key import at driver level.

OpenPGP: Some indentations need to be tab-size-independent.

OpenPGP: Check for null data when storing fingerprints.

OpenPGP: Allow to provide creation time to store (when gen/import key).
Old: Only store current time.
New: Can provide time to store, not only calculate current time.

OpenPGP: Correct setting content of pubkey blobs after key generation.

cardctl: Add definitions to support key import in OpenPGP.

OpenPGP: Add support for key import at driver level.
asn1: export 'asn1-write-element' function

... used by OpenPGP driver
pkcs15init-OpenPGP: Add store_data functions.

We need this function to use OpenPGP's specific action flow instead pkcs15init's default.
This will help to avoid redundant steps which may make the overall process fail.
pkcs15-init tool: Change the order of action.

DELETE_OBJECT will be done before STORE_XXX.
OpenPGP: Correct access condition for some pubkey blobs.

OpenPGP: Don't really delete pubkeys blobs.
pkcs15init-openpgp: Support for private key import in pkcs15init.

Example command:
pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key quan-key.pem  --auth-id 3 --verify-pin --extractable --id 3

pkcs15init-OpenPGP: Some parts in openpgp.profile are not used.
OpenPGP: Handle access on dummy files, which is assumed to exist by pkcs15init.

OpenPGP: Update card algorithms after importing key.

OpenPGP: Add SC_ALGORITHM_ONBOARD_KEY_GEN flag to card algorithms.
OpenPGP-pkcs15init: Support generating key via pkcs15-init tool.

OpenPGP-pkcs15int: Add more debug log.

OpenPGP-pkcs15init: Add more checks in key generation.
Check for key ID. Set default key.
Check for result of key generation from driver.
OpenPGP: Accept authentication key for S/MIME decrypting.

The card contains only 1 certificate, which can be used for encrypting.
But this certificate is bound with authentication key, so when decrypting,
the authentication key will be presented to check.
This commit allows to bypass the check in driver. However, it is not enough.
The users have to import the same key to "Encryption key" to help the card find
right key to work.

OpenPGP: Add log and comments.

OpenPGP: Pretend to select dummy files.
Some files are needed by pkcs15init, but not exist in OpenPGP card.
We pretend to know these dummy files to make pkcs15init successful.

Compilation error on windows:
when declaring array use explicit size, add pkcs15-openpgp.obj in Makefile.mak
sm: misplaced check of the 'get-sm-apdus' return code
sm: link 'local' SM module with OpenSSL's crypto library
sm: change SM data types, thanks to Frank Morgner for revision

http://www.opensc-project.org/pipermail/opensc-devel/2012-July/018232.html
Merge remote-tracking branch 'upstream/staging' into staging