| Index: crypto/signature_creator_nss.cc
|
| diff --git a/crypto/signature_creator_nss.cc b/crypto/signature_creator_nss.cc
|
| index 3a30efba480a3be7f76cd5a2715add5aa85d937e..6c21efe25fef8eb710e7c5852dcd8835124b2b69 100644
|
| --- a/crypto/signature_creator_nss.cc
|
| +++ b/crypto/signature_creator_nss.cc
|
| @@ -43,6 +43,29 @@ SignatureCreator* SignatureCreator::Create(RSAPrivateKey* key) {
|
| return result.release();
|
| }
|
|
|
| +// static
|
| +bool SignatureCreator::Sign(RSAPrivateKey* key,
|
| + const uint8* data,
|
| + int data_len,
|
| + std::vector<uint8>* signature) {
|
| + SECItem data_item;
|
| + data_item.type = siBuffer;
|
| + data_item.data = const_cast<unsigned char*>(data);
|
| + data_item.len = data_len;
|
| +
|
| + SECItem signature_item;
|
| + SECStatus rv = SGN_Digest(key->key(), SEC_OID_SHA1, &signature_item,
|
| + &data_item);
|
| + if (rv != SECSuccess) {
|
| + NOTREACHED();
|
| + return false;
|
| + }
|
| + signature->assign(signature_item.data,
|
| + signature_item.data + signature_item.len);
|
| + SECITEM_FreeItem(&signature_item, PR_FALSE);
|
| + return true;
|
| +}
|
| +
|
| bool SignatureCreator::Update(const uint8* data_part, int data_part_len) {
|
| // TODO(wtc): Remove this const_cast when we require NSS 3.12.5.
|
| // See NSS bug https://bugzilla.mozilla.org/show_bug.cgi?id=518255
|
|
|