IBM Crypto Education Community

  • 1.  CSNDDSV problem

    Posted Wed June 13, 2018 11:36 AM

    Having problem trying to make this work with my REXX attached, I think my understanding of the call is wrong because I'm getting a 7E0 reason code (rule array wrong).

     

    I build a public key token, and use it to do the verify. I've tried formatting the SHA-256 hash according to this: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.csfb400/csfb4954.htm 

    As well as inputting the hash as just a 32-byte string.

    hermanpun


  • 2.  Re: CSNDDSV problem

    Posted Fri June 15, 2018 04:47 PM

    Hello Herman...I have been working on your testcase.  You can have ICSF hash the message by changing the rule_array keyword "HASH" to "MESSAGE".  Then set DATA to the data to be hashed.  Unfortunately, when I ran your testcase, the signature failed to verify.  This indicates a problem with the public key, data or signature.  Attached are my updates to your testcase.

    EChan_pok

    Attachments



  • 3.  Re: CSNDDSV problem

    Posted Fri June 15, 2018 10:28 PM

    Thanks for taking a look Eleanor, it helps knowing that I should just use MESSAGE to verify. But yes you're right, the MESSAGE data I gave you in the testcase turned out to be wrong.

     

    I did figure out how to verify the sig, but not using ICSF. I suspect I'm creating the Public key token incorrectly ... which is strange because it seems pretty straightforward, and I've been able to sign/verify properly before using a private/public key pair I generated from a PKB call.

     

    So the way I did verify successfully was with openSSL.

    The message data is in test.hex, and I then use certreq to convert into ASCII: certutil -decodehex "test.hex" "test.txt" 

    For convenience I also attached test.txt.

    signature.sha256 is a binary transfer from zOS, same data as the sig field in my REXX.

     

    rsapub.pem is the pub key I extracted from pub.der, which is what I grabbed the modulus from for my REXX.

     

    So if you run "openssl dsgt -sha256 -verify rsapub.pem -signature sig.sha256 test.txt"

    it should verify OK.

     

    My problem now is that I'm trying to verify using ICSF with what should be the correct data, but it's not working. Like I said above I suspect it might be the public key token, so once I get the appropriate access (ugh) ... I'm going to add the cert into the PKDS and try again.

    If you have the time please help me take a look again, thanks!

    hermanpun


  • 4.  Re: CSNDDSV problem

    Posted Mon June 18, 2018 02:33 PM

    Herman,

    I tried your new testcase DDSV_2, but it also failed verification, 4/2AF8x.  However, I played with other digital signature formatting methods and was able to verify the signature by changing X9.31 to PKCS-1.1 in the DSV rule_array.

    So please check that you are using the same digital signature formatting method that was used to generate the signature.

    EChan_pok