Fix typo in CONTRIBUTING.md
[openssl.git] / crypto / modes / ocb128.c
index 713b9aaf19d5ff7023887f4882cc83c97a12005b..1ae807c100d015265ebef8edba7cdbed11573c23 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/err.h>
-#include "modes_lcl.h"
+#include "crypto/modes.h"
 
 #ifndef OPENSSL_NO_OCB
 
@@ -155,10 +155,8 @@ int CRYPTO_ocb128_init(OCB128_CONTEXT *ctx, void *keyenc, void *keydec,
     memset(ctx, 0, sizeof(*ctx));
     ctx->l_index = 0;
     ctx->max_l_index = 5;
-    if ((ctx->l = OPENSSL_malloc(ctx->max_l_index * 16)) == NULL) {
-        CRYPTOerr(CRYPTO_F_CRYPTO_OCB128_INIT, ERR_R_MALLOC_FAILURE);
+    if ((ctx->l = OPENSSL_malloc(ctx->max_l_index * 16)) == NULL)
         return 0;
-    }
 
     /*
      * We set both the encryption and decryption key schedules - decryption
@@ -202,10 +200,8 @@ int CRYPTO_ocb128_copy_ctx(OCB128_CONTEXT *dest, OCB128_CONTEXT *src,
     if (keydec)
         dest->keydec = keydec;
     if (src->l) {
-        if ((dest->l = OPENSSL_malloc(src->max_l_index * 16)) == NULL) {
-            CRYPTOerr(CRYPTO_F_CRYPTO_OCB128_COPY_CTX, ERR_R_MALLOC_FAILURE);
+        if ((dest->l = OPENSSL_malloc(src->max_l_index * 16)) == NULL)
             return 0;
-        }
         memcpy(dest->l, src->l, (src->l_index + 1) * 16);
     }
     return 1;