Check-in [0c7c510048]
Overview
SHA1:0c7c5100481f28840eabea699c6cf08d266ca269
Date: 2017-07-17 13:56:51
User: rkeene
Comment:Updated to treat returning a zero-length signed message as an error
Timelines: family | ancestors | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-07-17
13:56
[0c7c510048] Leaf: Updated to treat returning a zero-length signed message as an error (user: rkeene, tags: trunk)
13:56
[d02f2af7a5] Corrected typo causing debug builds to fail (user: rkeene, tags: trunk)
Changes

Modified build/chrome/cackey-chrome-pkcs11.c from [d840c2c357] to [8bb129b692].

   600    600   						chk_rv = moduleFunctionList->C_SignInit(hSession, &signMechanism, hKey);
   601    601   						if (chk_rv != CKR_OK) {
   602    602   							break;
   603    603   						}
   604    604   
   605    605   						tmpDestinationLength = *destinationLength;
   606    606   						chk_rv = moduleFunctionList->C_Sign(hSession, data, dataLength, destination, &tmpDestinationLength);
          607  +
          608  +						if (tmpDestinationLength == 0) {
          609  +							chk_rv = CKR_GENERAL_ERROR;
          610  +						}
          611  +
   607    612   						switch (chk_rv) {
   608    613   							case CKR_OK:
   609    614   								*destinationLength = tmpDestinationLength;
   610    615   								retval = CACKEY_CHROME_OK;
   611    616   								break;
   612    617   							case CKR_USER_NOT_LOGGED_IN:
   613    618   								retval = CACKEY_CHROME_NEEDLOGIN;

Modified build/chrome/cackey-chrome-plugin.cc from [77c6f00e8d] to [c633169af7].

   114    114   						pin = message->Get("pin").AsString().c_str();
   115    115   					} else {
   116    116   						pin = NULL;
   117    117   					}
   118    118   
   119    119   					incomingCertificateCACKey.certificate = incomingCertificateContents->Map();					
   120    120   					incomingCertificateCACKey.certificate_len = incomingCertificateContents->ByteLength();					
   121         -
   122    121   					outgoingDataLength = sizeof(buffer);
   123    122   
   124    123   					signRet = cackey_chrome_signMessage(&incomingCertificateCACKey,
   125    124   						incomingData->Map(), incomingData->ByteLength(),
   126    125   						buffer, &outgoingDataLength,
   127    126   						&pinPrompt, pin
   128    127   					);