aruaravind / jcardsim

Automatically exported from code.google.com/p/jcardsim
0 stars 0 forks source link

Call of getDefaultKeyGenerationParameters() in getKeyGenerationParameters() (class ECKeyImpl) mixes KeyType with AlgorithmType #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
when calling the function 
public KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd) 
from the class ECKeyImpl with an uninitialized Key, the function

getDefaultKeyGenerationParameters(type, size, rnd) gets called

where type is a constant from the keyBuilder ( 
http://www.win.tue.nl/pinpasjc/docs/apis/jc222/constant-values.html#javacard.sec
urity.KeyBuilder.TYPE_EC_FP_PRIVATE ).

in the called function
getDefaultKeyGenerationParameters(byte algorithm, short keySize, SecureRandom 
rnd) {
        byte keyType = algorithm == KeyPair.ALG_EC_FP ? KeyBuilder.TYPE_EC_FP_PUBLIC : KeyBuilder.TYPE_EC_F2M_PUBLIC;

this type variable gets compared to constants from the KeyPair class 
(http://www.win.tue.nl/pinpasjc/docs/apis/jc222/constant-values.html#javacard.se
curity.KeyPair.ALG_EC_FP)

directly calling getDefaultsDomainParameters() from 
getKeyGenerationParameters() would solve the problem.

Original issue reported on code.google.com by petermah...@gmail.com on 1 Oct 2013 at 5:36

GoogleCodeExporter commented 9 years ago
For a patch please see 
https://github.com/mali1/jCardSim/commit/72dd9349b1cb45fa9b2fda47e1ce06c71a3e6f6
5

Original comment by petermah...@gmail.com on 4 Oct 2013 at 7:22

GoogleCodeExporter commented 9 years ago
We moved to GitHub, in this connection we are closing issue tracker here. Your 
issue available here now - https://github.com/licel/jcardsim/issues/22. Become 
a watcher and you will be able to receive all updates on the project. To check 
progress on your issue click the link above.

Original comment by jcard...@licel.ru on 25 Oct 2013 at 2:11