Add AzeDIT 3.5 card support

AzeDIT cards are similar to EstEID 3.5 cards but have their own
cold ATR and AID
iso7816: allow extended length APDUs
openpgp-tool: Return EXIT_SUCCESS if no error occurs

exit_status is either set directly or a function return is ORed with it,
in which case EXIT_SUCCESS can never be returned if the initial value is !=
0;
Add AES support for PIV General Authenticate

This adds algorithm IDs 0xA, 0xA, 0xC which as documented
by the NIST PIV specification is algorithms AES-128, AES-192
and AES-256 respectively.

This patch also addresses some of the hardcodes that prevented
nonces greater than the single byte TLV length tags would allow.
It was explicitly tested with AES-256 and 256 byte nonces.

Signed-off-by: William Roberts <w2.roberts@samsung.com>
pkcs11-tool sets CKA_DECRYPT=true rather then CKA_DERIVE=true when generating EC keys (#277)

RSA and EC keys have different usage attributes. Appropriate attributes are set
When using --keypairgen the user can use the --usage-sign, --usage-decrypt,
and --usage-derive. to get finer control.

 Changes to be committed:
	modified:   tools/pkcs11-tool.c
iso7816: propagate the length of the computed signature
Merge pull request #270 from shootingatshadow/aes-support

Add AES support for PIV General Authenticate

 adds new routine sc_right_trim in sc.c and opensc.h. It is used by  PIV card driver when using the piv-tool.
Merge branch 'master' of github.com:OpenSC/OpenSC
Remove hardcodes from Mutual Authenticate

Support nonces that are not only 8 bytes in
Mutual Authenticate. Use the witness length
to determine the nonce size, thus existing
systems using 8 bytes will continue to use 8
bytes. However, with AES 256, the nonces could
be a single block size of 16 bytes or greater.
md: install minidriver by default
Merge pull request #253 from github-frankmorgner/remove-deadcode

card-asepcos: removed dead code
card-authentic: removed dead code
card-belpic: removed dead code
card-epass2003: removed dead code
card-flex: removed dead code
card-gpk: removed dead code
card-oberthur: removed dead code
card-piv: removed dead code
card-setcos: removed dead code
ctbcs: removed dead code
cwa14890: removed dead code
muscle: removed dead code
pkcs15-atrust-acos: removed dead code
pkcs15-gemsafeV1: removed dead code
pkcs15-skey: removed dead code
reader-ctapi: removed dead code
framework-pkcs15: removed dead code
pkcs11-object: removed dead code
pkcs15-asepcos: removed dead code
pkcs15-cardos: removed dead code
pkcs15-jcop: removed dead code
pkcs15-lib: removed dead code
pkcs15-oberthur: removed dead code
parse: removed dead code
sclex: removed dead code
sm-card-authentic: removed dead code
sm-card-iasecc: removed dead code
sm-cwa14890: removed dead code
sm-global-platform: removed dead code
sc-test: removed dead code
pkcs11-tool: removed dead code
pkcs15-tool: removed dead code
fixed pkcs15 version check
Target minimum OSX version to 10.7
pkcs11: Fixed wrong reference to PIN object in C_SetPIN() for SO-PIN
pkcs15-tool: fixed file reading
Fix error when signing with Swedish BankID card

Added card type check in addition to check for SC_SEC_ENV_KEY_REF_PRESENT

Added card type check in addition to check for SC_SEC_ENV_KEY_REF_PRESENT
Merge pull request #274 from github-asmw/private-do-3

openpgp-tool: Added PRIVATE-DO-3 dump option

The bytes of private-do-3 will be written to stdout raw.
Requires pin and verify to work.

openpgp-tool: Fix private-do-3 dump for Windows

fwrite will convert line endings on Windows if the destination
is not openend in binary mode. As this actually dumps binary data,
it makes sense to reopen stdout in binary mode for the dump.

openpgp-tool: Enable dumping of all DOs

PRIVATE-DO-<X> can now be dumped via the -d/--do switches and
the DO number as a parameter.
PRIVATE-DO-[12] can be dumped without verification.
PRIVATE-DO-3 requires CHV2, PRIVATE-DO-4 CHV3.

openpgp-tool: Dump DOs as hex into a tty, binary otherwise

This prevents messing up a terminal if there really _is_
binary data in a private DO. To force the binary data to a terminal,
pipe through cat.

openpgp-tool: Hint at the pin and verify options on error

SC_ERROR_SECURITY_STATUS_NOT_SATISFIED is the error code
here when dumping a private DO without the appropriate verification.

openpgp-tool: Explictly use --raw for binary ouput

The --raw switch already exists. If present, raw binary will be written,
a pretty-printed hex/ascii representation otherwise.
sc-hsm: Improve error detection and reporting in sc-hsm-tool
sc-hsm: Added error if private key import tried

Private key import is not supported by the SmartCard-HSM. However there is no error code
if it is still tried using pkcs15-init or from within Firefox.
sc-hsm: Fix certificate delete bug

If a certificate is deleted after the related private key, then the driver
picks the wrong certificate EF, leading to an CKR_GENERAL_ERROR or the wrong
certificate being deleted.