Add solaris assembler fixes for legacy provider
[openssl.git] / providers / implementations / ciphers / cipher_des_hw.c
index 7181c2290c1c5fe1842d1e63bb2fc5a1c1e5c284..f52bade45ee12cb162697d9f26c4d5aff92752d3 100644 (file)
@@ -65,7 +65,13 @@ static int cipher_hw_des_ecb_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
 static int cipher_hw_des_cbc_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out,
                                     const unsigned char *in, size_t len)
 {
-    DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks);
+    PROV_DES_CTX *dctx = (PROV_DES_CTX *)ctx;
+    DES_key_schedule *key = &(dctx->dks.ks);
+
+    if (dctx->dstream.cbc != NULL) {
+        (*dctx->dstream.cbc) (in, out, len, key, ctx->iv);
+        return 1;
+    }
 
     while (len >= MAXCHUNK) {
         DES_ncbc_encrypt(in, out, MAXCHUNK, key, (DES_cblock *)ctx->iv,