Backed out changeset 4626e0cede57
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Fri, 13 Apr 2018 09:44:21 +0200
changeset 14324 e32e2755932b7c9682091187f2570065f1f411f4
parent 14323 4626e0cede57956b9dbcb72135753668c819a3c0
child 14325 7768f56506bb096892092489be9d99011b6ab750
push id3059
push userfranziskuskiefer@gmail.com
push dateFri, 13 Apr 2018 07:44:30 +0000
backs out4626e0cede57956b9dbcb72135753668c819a3c0
Backed out changeset 4626e0cede57
lib/freebl/blake2b.c
--- a/lib/freebl/blake2b.c
+++ b/lib/freebl/blake2b.c
@@ -213,32 +213,31 @@ blake2b_IncrementCompress(BLAKE2BContext
 /**
  * This function updates blake2b ctx and can be used for both keyed and unkeyed
  * version.
  */
 SECStatus
 BLAKE2B_Update(BLAKE2BContext* ctx, const unsigned char* in,
                unsigned int inlen)
 {
-    PORT_Assert(ctx != NULL);
-    PORT_Assert(in != NULL);
-    if (!ctx || !in) {
-        PORT_SetError(SEC_ERROR_INVALID_ARGS);
-        return SECFailure;
-    }
-
     size_t left = ctx->buflen;
     size_t fill = BLAKE2B_BLOCK_LENGTH - left;
-    PORT_Assert(left <= BLAKE2B_BLOCK_LENGTH);
 
     /* Nothing to do if there's nothing. */
     if (inlen == 0) {
         return SECSuccess;
     }
 
+    PORT_Assert(ctx != NULL);
+    PORT_Assert(in != NULL);
+    PORT_Assert(left <= BLAKE2B_BLOCK_LENGTH);
+    if (!ctx || !in) {
+        PORT_SetError(SEC_ERROR_INVALID_ARGS);
+        return SECFailure;
+    }
 
     /* Is this a reused context? */
     if (ctx->f) {
         PORT_SetError(SEC_ERROR_INVALID_ARGS);
         return SECFailure;
     }
 
     if (inlen > fill) {