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
601
602
603
604
605
606





607
608
609
610
611
612
613
						chk_rv = moduleFunctionList->C_SignInit(hSession, &signMechanism, hKey);
						if (chk_rv != CKR_OK) {
							break;
						}

						tmpDestinationLength = *destinationLength;
						chk_rv = moduleFunctionList->C_Sign(hSession, data, dataLength, destination, &tmpDestinationLength);





						switch (chk_rv) {
							case CKR_OK:
								*destinationLength = tmpDestinationLength;
								retval = CACKEY_CHROME_OK;
								break;
							case CKR_USER_NOT_LOGGED_IN:
								retval = CACKEY_CHROME_NEEDLOGIN;







>
>
>
>
>







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
						chk_rv = moduleFunctionList->C_SignInit(hSession, &signMechanism, hKey);
						if (chk_rv != CKR_OK) {
							break;
						}

						tmpDestinationLength = *destinationLength;
						chk_rv = moduleFunctionList->C_Sign(hSession, data, dataLength, destination, &tmpDestinationLength);

						if (tmpDestinationLength == 0) {
							chk_rv = CKR_GENERAL_ERROR;
						}

						switch (chk_rv) {
							case CKR_OK:
								*destinationLength = tmpDestinationLength;
								retval = CACKEY_CHROME_OK;
								break;
							case CKR_USER_NOT_LOGGED_IN:
								retval = CACKEY_CHROME_NEEDLOGIN;

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

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
						pin = message->Get("pin").AsString().c_str();
					} else {
						pin = NULL;
					}

					incomingCertificateCACKey.certificate = incomingCertificateContents->Map();					
					incomingCertificateCACKey.certificate_len = incomingCertificateContents->ByteLength();					

					outgoingDataLength = sizeof(buffer);

					signRet = cackey_chrome_signMessage(&incomingCertificateCACKey,
						incomingData->Map(), incomingData->ByteLength(),
						buffer, &outgoingDataLength,
						&pinPrompt, pin
					);







<







114
115
116
117
118
119
120

121
122
123
124
125
126
127
						pin = message->Get("pin").AsString().c_str();
					} else {
						pin = NULL;
					}

					incomingCertificateCACKey.certificate = incomingCertificateContents->Map();					
					incomingCertificateCACKey.certificate_len = incomingCertificateContents->ByteLength();					

					outgoingDataLength = sizeof(buffer);

					signRet = cackey_chrome_signMessage(&incomingCertificateCACKey,
						incomingData->Map(), incomingData->ByteLength(),
						buffer, &outgoingDataLength,
						&pinPrompt, pin
					);