alpine 3.6
crypto weakness #56


Weakness Breakdown


This weakness involves creating non-standard or non-tested algorithms, using weak algorithms or applying cryptographic algorithms incorrectly. Algorithms that were once considered safe are commonly later found to be unsafe, as the algorithms were broken.

Warning code(s):

DES only supports a 56-bit keysize, which is too small given today's computers.

File Name:



The highlighted line of code below is the trigger point of this particular Alpine 3.6 crypto weakness.

     zap(iblock, sizeof(iblock));
    zap(oblock, sizeof(oblock));

    if (ret != 1)
        return KRB5_CRYPTO_INTERNAL;
    return 0;

static krb5_error_code
k5_des_decrypt(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
               size_t num_data)
    int ret, olen = DES_BLOCK_SIZE;
    unsigned char iblock[DES_BLOCK_SIZE], oblock[DES_BLOCK_SIZE];
    struct iov_cursor cursor;
    EVP_CIPHER_CTX ciph_ctx;
    krb5_boolean empty;

    ret = validate(key, ivec, data, num_data, &empty);
    if (ret != 0 || empty)
        return ret;


    ret = EVP_DecryptInit_ex(&ciph_ctx, EVP_des_cbc(), NULL,
                             (ivec) ? (unsigned char*)ivec->data : NULL);
    if (!ret)
        return KRB5_CRYPTO_INTERNAL;


    k5_iov_cursor_init(&cursor, data, num_data, DES_BLOCK_SIZE, FALSE);
    while (k5_iov_cursor_get(&cursor, iblock)) {
        ret = EVP_DecryptUpdate(&ciph_ctx, oblock, &olen,
                                iblock, DES_BLOCK_SIZE);
        if (!ret)
        k5_iov_cursor_put(&cursor, oblock);

    if (ivec != NULL)
        memcpy(ivec->data, iblock, DES_BLOCK_SIZE);


    zap(iblock, sizeof(iblock));
    zap(oblock, sizeof(oblock));

    if (ret != 1) 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.