Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
[cascardo/linux.git] / crypto / drbg.c
index a76b3cb..7894db9 100644 (file)
@@ -184,7 +184,7 @@ static const struct drbg_core drbg_cores[] = {
 #endif /* CONFIG_CRYPTO_DRBG_HASH */
 #ifdef CONFIG_CRYPTO_DRBG_HMAC
        {
-               .flags = DRBG_HMAC | DRBG_STRENGTH256,
+               .flags = DRBG_HMAC | DRBG_STRENGTH128,
                .statelen = 20, /* block length of cipher */
                .max_addtllen = 35,
                .max_bits = 19,
@@ -1500,7 +1500,7 @@ static int drbg_generate_long(struct drbg_state *drbg,
                if (0 >= tmplen)
                        return tmplen;
                len += tmplen;
-       } while (slice > 0);
+       } while (slice > 0 && (len < buflen));
        return len;
 }
 
@@ -2019,7 +2019,7 @@ static int __init drbg_init(void)
        return crypto_register_algs(drbg_algs, (ARRAY_SIZE(drbg_cores) * 2));
 }
 
-void __exit drbg_exit(void)
+static void __exit drbg_exit(void)
 {
        crypto_unregister_algs(drbg_algs, (ARRAY_SIZE(drbg_cores) * 2));
 }