Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c

Issue 21968004: Updated usrsctp to fix various issues for windows (using changes pushed upstream) and unified SHA1 … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed indent Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c
diff --git a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c
index 2274f8c8ad675905e0ded690c8daa7b9c9812596..b87ff71844e8c103b8b7251c92eab38f396cd812 100644
--- a/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c
+++ b/third_party/usrsctp/overrides/usrsctplib/netinet/sctp_nss_sha1.c
@@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$");
#ifdef SCTP_USE_NSS_SHA1
#include <netinet/sctp_nss_sha1.h>
+/* A SHA-1 Digest is 160 bits, or 20 bytes */
+#define SHA_DIGEST_LENGTH (20)
+
void
SCTP_NSS_SHA1_Init(struct sha1_context *ctx)
{
@@ -55,7 +58,7 @@ void
SCTP_NSS_SHA1_Final(unsigned char *digest, struct sha1_context *ctx)
{
unsigned int output_len = 0;
- PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, sizeof(digest));
+ PK11_DigestFinal(ctx->pk11_ctx, digest, &output_len, SHA_DIGEST_LENGTH);
PK11_DestroyContext(ctx->pk11_ctx, PR_TRUE);
}
#endif

Powered by Google App Engine
This is Rietveld 408576698