CR ENGR00046932 - Sahara build warnings are resolved.
authorQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:24:58 +0000 (21:24 -0600)
committerQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:24:58 +0000 (21:24 -0600)
Patch for CR ENGR00046932 - Sahara build warnings are resolved.
Removed unsupported SSL code.  Applies to linux 2.6.22 kernel
for MX platforms.

http://www.bitshrine.org/gpp/linux-2.6.22-mx-CR-ENGR00046932-Sahara-build-warnings-are-.patch

drivers/mxc/security/rng/include/shw_driver.h
drivers/mxc/security/sahara2/fsl_shw_auth.c
drivers/mxc/security/sahara2/include/sahara.h

index 79b20757932e8886e6bf23a7d9d674c481f0dbc1..f0d1576a8fc998b5ffc95618fd6de218648b1b1f 100644 (file)
@@ -223,12 +223,6 @@ typedef enum fsl_shw_acc_mode_t {
         * be non-multiple of block size.  This mode may be used for AES.
         */
        FSL_ACC_MODE_CCM,
-       /*!
-        * SSL mode.  Not supported.  Combines HMAC and encrypt (or decrypt).
-        * Needs one key object for encryption, another for the HMAC.  The usual
-        * hashing and symmetric encryption algorithms are supported.
-        */
-       FSL_ACC_MODE_SSL
 } fsl_shw_acc_mode_t;
 
 /* REQ-FSLSHW-PINTFC-COA-HCO-001 */
index a5aac3ff76491c6c987d5405048c99b1ba11b7d9..edbaf6488a4426153e2c37b1e1214f89fce113e7 100644 (file)
@@ -448,100 +448,6 @@ static inline fsl_shw_return_t encrypt_mac(sah_Head_Desc ** desc_chain,
        return status;
 }
 
-#if SUPPORT_SSL
-/*!
- * Generate an SSL value
- *
- * @param         user_ctx         Info for acquiring memory
- * @param         auth_ctx         Info for CTR0, size of MAC
- * @param         cipher_key_info
- * @param         auth_key_info
- * @param         auth_data_length
- * @param         auth_data
- * @param         payload_length
- * @param         payload
- * @param         ct
- * @param         auth_value
- *
- * @return    A return code of type #fsl_shw_return_t.
- */
-static fsl_shw_return_t do_ssl_gen(fsl_shw_uco_t * user_ctx,
-                                  fsl_shw_acco_t * auth_ctx,
-                                  fsl_shw_sko_t * cipher_key_info,
-                                  fsl_shw_sko_t * auth_key_info,
-                                  uint32_t auth_data_length,
-                                  const uint8_t * auth_data,
-                                  uint32_t payload_length,
-                                  const uint8_t * payload,
-                                  uint8_t * ct, uint8_t * auth_value)
-{
-       SAH_SF_DCLS;
-       uint8_t *ptr1 = NULL;
-
-       /* Assume one-shot init-finalize... no precomputes */
-       header = SAH_HDR_MDHA_SET_MODE_MD_KEY ^
-           sah_insert_mdha_algorithm[auth_ctx->auth_info.hash_ctx_info.
-                                     algorithm] ^ sah_insert_mdha_init ^
-           sah_insert_mdha_ssl ^ sah_insert_mdha_pdata ^
-           sah_insert_mdha_mac_full;
-
-       /* set up hmac */
-       DESC_IN_KEY(header, 0, NULL, auth_key_info);
-
-       /* This is wrong -- need to find 16 extra bytes of data from
-        * somewhere */
-       DESC_IN_OUT(SAH_HDR_MDHA_HASH, payload_length, payload, 1, auth_value);
-
-       /* set up encrypt */
-       header = SAH_HDR_SKHA_SET_MODE_IV_KEY
-           ^ sah_insert_skha_mode[auth_ctx->cipher_ctx_info.mode]
-           ^ sah_insert_skha_encrypt
-           ^ sah_insert_skha_algorithm[cipher_key_info->algorithm];
-
-       /* Honor 'no key parity checking' for DES and TDES */
-       if ((cipher_key_info->flags & FSL_SKO_KEY_IGNORE_PARITY) &&
-           ((cipher_key_info->algorithm == FSL_KEY_ALG_DES) ||
-            (cipher_key_info->algorithm == FSL_KEY_ALG_TDES))) {
-               header ^= sah_insert_skha_no_key_parity;
-       }
-
-       if (auth_ctx->cipher_ctx_info.mode == FSL_SYM_MODE_CTR) {
-               header ^=
-                   sah_insert_skha_modulus[auth_ctx->cipher_ctx_info.
-                                           modulus_exp];
-       }
-
-       if ((auth_ctx->cipher_ctx_info.mode == FSL_SYM_MODE_ECB)
-           || (auth_ctx->cipher_ctx_info.flags & FSL_SYM_CTX_INIT)) {
-               ptr1 = block_zeros;
-       } else {
-               ptr1 = auth_ctx->cipher_ctx_info.context;
-       }
-
-       DESC_IN_KEY(header, auth_ctx->cipher_ctx_info.block_size_bytes, ptr1,
-                   cipher_key_info);
-
-       /* This is wrong -- need to find 16 extra bytes of data from
-        * somewhere...
-        */
-       if (payload_length != 0) {
-               DESC_IN_OUT(SAH_HDR_SKHA_ENC_DEC,
-                           payload_length, payload, payload_length, ct);
-       }
-
-       SAH_SF_EXECUTE();
-
-      out:
-       SAH_SF_DESC_CLEAN();
-
-       /* Eliminate compiler warnings until full implementation... */
-       (void)auth_data;
-       (void)auth_data_length;
-
-       return ret;
-}                              /* do_ssl_gen() */
-#endif
-
 /*!
  * @brief Generate a (CCM) auth code and encrypt the payload.
  *
@@ -594,17 +500,6 @@ fsl_shw_return_t fsl_shw_gen_encrypt(fsl_shw_uco_t * user_ctx,
 
        SAH_SF_USER_CHECK();
 
-       if (auth_ctx->mode == FSL_ACC_MODE_SSL) {
-#if SUPPORT_SSL
-               ret = do_ssl_gen(user_ctx, auth_ctx, cipher_key_info,
-                                auth_key_info, auth_data_length, auth_data,
-                                payload_length, payload, ct, auth_value);
-#else
-               ret = FSL_RETURN_BAD_MODE_S;
-#endif
-               return ret;
-       }
-
        if (auth_ctx->mode != FSL_ACC_MODE_CCM) {
                ret = FSL_RETURN_BAD_MODE_S;
                goto out;
index b7681e0c34ec93dab534f2ff38063e15f981736d..c40a70241f21376016e3fe1d986e577010836747 100644 (file)
@@ -373,12 +373,6 @@ typedef enum fsl_shw_acc_mode_t {
         * be non-multiple of block size.  This mode may be used for AES.
         */
        FSL_ACC_MODE_CCM,
-       /*!
-        * SSL mode.  Not supported.  Combines HMAC and encrypt (or decrypt).
-        * Needs one key object for encryption, another for the HMAC.  The usual
-        * hashing and symmetric encryption algorithms are supported.
-        */
-       FSL_ACC_MODE_SSL,
 } fsl_shw_acc_mode_t;
 
 /* REQ-S2LRD-PINTFC-COA-HCO-001 */