crypto/evp/e_aes.c:2618: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [0, 15]):unsigned64.
Showing all 5 steps of the trace


crypto/evp/e_aes.c:2540:1: <LHS trace>
2538.   }
2539.   
2540. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2541.                             const unsigned char *in, size_t len)
2542.   {

crypto/evp/e_aes.c:2540:1: Parameter `len`
2538.   }
2539.   
2540. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2541.                             const unsigned char *in, size_t len)
2542.   {

crypto/evp/e_aes.c:2540:1: <RHS trace>
2538.   }
2539.   
2540. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2541.                             const unsigned char *in, size_t len)
2542.   {

crypto/evp/e_aes.c:2540:1: Parameter `len`
2538.   }
2539.   
2540. > static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
2541.                             const unsigned char *in, size_t len)
2542.   {

crypto/evp/e_aes.c:2618:22: Binary operation: ([0, +oo] - [0, 15]):unsigned64
2616.                       return -1;
2617.               } else if (EVP_CIPHER_CTX_encrypting(ctx)) {
2618.                   if (!CRYPTO_ocb128_encrypt
                             ^
2619.                       (&octx->ocb, in, out, len - trailing_len))
2620.                       return -1;

static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
                          const unsigned char *in, size_t len)
{
    unsigned char *buf;
    int *buf_len;
    int written_len = 0;
    size_t trailing_len;
    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX,ctx);
    if (!octx->iv_set)
        return -1;
    if (!octx->key_set)
        return -1;
    if (in) {
        if (out == NULL) {
            buf = octx->aad_buf;
            buf_len = &(octx->aad_buf_len);
        } else {
            buf = octx->data_buf;
            buf_len = &(octx->data_buf_len);
        }
        if (*buf_len) {
            unsigned int remaining;
            remaining = 16 - (*buf_len);
            if (remaining > len) {
                memcpy(buf + (*buf_len), in, len);
                *(buf_len) += len;
                return 0;
            }
            memcpy(buf + (*buf_len), in, remaining);
            len -= remaining;
            in += remaining;
            if (out == NULL) {
                if (!CRYPTO_ocb128_aad(&octx->ocb, buf, 16))
                    return -1;
            } else if (EVP_CIPHER_CTX_encrypting(ctx)) {
                if (!CRYPTO_ocb128_encrypt(&octx->ocb, buf, out, 16))
                    return -1;
            } else {
                if (!CRYPTO_ocb128_decrypt(&octx->ocb, buf, out, 16))
                    return -1;
            }
            written_len = 16;
            *buf_len = 0;
        }
        trailing_len = len % 16;
        if (len != trailing_len) {
            if (out == NULL) {
                if (!CRYPTO_ocb128_aad(&octx->ocb, in, len - trailing_len))
                    return -1;
            } else if (EVP_CIPHER_CTX_encrypting(ctx)) {
                if (!CRYPTO_ocb128_encrypt
                    (&octx->ocb, in, out, len - trailing_len))
                    return -1;
            } else {
                if (!CRYPTO_ocb128_decrypt
                    (&octx->ocb, in, out, len - trailing_len))
                    return -1;
            }
            written_len += len - trailing_len;
            in += len - trailing_len;
        }
        if (trailing_len) {
            memcpy(buf, in, trailing_len);
            *buf_len = trailing_len;
        }
        return written_len;
    } else {
        if (octx->data_buf_len) {
            if (EVP_CIPHER_CTX_encrypting(ctx)) {
                if (!CRYPTO_ocb128_encrypt(&octx->ocb, octx->data_buf, out,
                                           octx->data_buf_len))
                    return -1;
            } else {
                if (!CRYPTO_ocb128_decrypt(&octx->ocb, octx->data_buf, out,
                                           octx->data_buf_len))
                    return -1;
            }
            written_len = octx->data_buf_len;
            octx->data_buf_len = 0;
        }
        if (octx->aad_buf_len) {
            if (!CRYPTO_ocb128_aad
                (&octx->ocb, octx->aad_buf, octx->aad_buf_len))
                return -1;
            octx->aad_buf_len = 0;
        }
        if (!EVP_CIPHER_CTX_encrypting(ctx)) {
            if (octx->taglen < 0)
                return -1;
            if (CRYPTO_ocb128_finish(&octx->ocb,
                                     octx->tag, octx->taglen) != 0)
                return -1;
            octx->iv_set = 0;
            return written_len;
        }
        if (CRYPTO_ocb128_tag(&octx->ocb, octx->tag, 16) != 1)
            return -1;
        octx->iv_set = 0;
        return written_len;
    }
}
['static int aes_ocb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,\n                          const unsigned char *in, size_t len)\n{\n    unsigned char *buf;\n    int *buf_len;\n    int written_len = 0;\n    size_t trailing_len;\n    EVP_AES_OCB_CTX *octx = EVP_C_DATA(EVP_AES_OCB_CTX,ctx);\n    if (!octx->iv_set)\n        return -1;\n    if (!octx->key_set)\n        return -1;\n    if (in) {\n        if (out == NULL) {\n            buf = octx->aad_buf;\n            buf_len = &(octx->aad_buf_len);\n        } else {\n            buf = octx->data_buf;\n            buf_len = &(octx->data_buf_len);\n        }\n        if (*buf_len) {\n            unsigned int remaining;\n            remaining = 16 - (*buf_len);\n            if (remaining > len) {\n                memcpy(buf + (*buf_len), in, len);\n                *(buf_len) += len;\n                return 0;\n            }\n            memcpy(buf + (*buf_len), in, remaining);\n            len -= remaining;\n            in += remaining;\n            if (out == NULL) {\n                if (!CRYPTO_ocb128_aad(&octx->ocb, buf, 16))\n                    return -1;\n            } else if (EVP_CIPHER_CTX_encrypting(ctx)) {\n                if (!CRYPTO_ocb128_encrypt(&octx->ocb, buf, out, 16))\n                    return -1;\n            } else {\n                if (!CRYPTO_ocb128_decrypt(&octx->ocb, buf, out, 16))\n                    return -1;\n            }\n            written_len = 16;\n            *buf_len = 0;\n        }\n        trailing_len = len % 16;\n        if (len != trailing_len) {\n            if (out == NULL) {\n                if (!CRYPTO_ocb128_aad(&octx->ocb, in, len - trailing_len))\n                    return -1;\n            } else if (EVP_CIPHER_CTX_encrypting(ctx)) {\n                if (!CRYPTO_ocb128_encrypt\n                    (&octx->ocb, in, out, len - trailing_len))\n                    return -1;\n            } else {\n                if (!CRYPTO_ocb128_decrypt\n                    (&octx->ocb, in, out, len - trailing_len))\n                    return -1;\n            }\n            written_len += len - trailing_len;\n            in += len - trailing_len;\n        }\n        if (trailing_len) {\n            memcpy(buf, in, trailing_len);\n            *buf_len = trailing_len;\n        }\n        return written_len;\n    } else {\n        if (octx->data_buf_len) {\n            if (EVP_CIPHER_CTX_encrypting(ctx)) {\n                if (!CRYPTO_ocb128_encrypt(&octx->ocb, octx->data_buf, out,\n                                           octx->data_buf_len))\n                    return -1;\n            } else {\n                if (!CRYPTO_ocb128_decrypt(&octx->ocb, octx->data_buf, out,\n                                           octx->data_buf_len))\n                    return -1;\n            }\n            written_len = octx->data_buf_len;\n            octx->data_buf_len = 0;\n        }\n        if (octx->aad_buf_len) {\n            if (!CRYPTO_ocb128_aad\n                (&octx->ocb, octx->aad_buf, octx->aad_buf_len))\n                return -1;\n            octx->aad_buf_len = 0;\n        }\n        if (!EVP_CIPHER_CTX_encrypting(ctx)) {\n            if (octx->taglen < 0)\n                return -1;\n            if (CRYPTO_ocb128_finish(&octx->ocb,\n                                     octx->tag, octx->taglen) != 0)\n                return -1;\n            octx->iv_set = 0;\n            return written_len;\n        }\n        if (CRYPTO_ocb128_tag(&octx->ocb, octx->tag, 16) != 1)\n            return -1;\n        octx->iv_set = 0;\n        return written_len;\n    }\n}']