]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Removed extra calls to HMAC_CTX_init()
authorAlan T. DeKok <aland@freeradius.org>
Wed, 10 Nov 2010 14:13:20 +0000 (15:13 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 10 Nov 2010 14:13:20 +0000 (15:13 +0100)
Noticed by James Ballantine

src/modules/rlm_wimax/rlm_wimax.c

index b2d474a5843918284e6f79482e92e4f9c20ec49b..2318507e5a0d866a23c09fb8c47a08f37976a166 100644 (file)
@@ -222,7 +222,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
        /*
         *      MIP-RK-2 = HMAC-SSHA256(EMSK, MIP-RK-1 | usage-data | 0x01)
         */
-       HMAC_CTX_init(&hmac);
        HMAC_Init_ex(&hmac, emsk->vp_octets, emsk->length, EVP_sha256(), NULL);
        
        HMAC_Update(&hmac, (const uint8_t *) &mip_rk_1, rk1_len);
@@ -239,7 +238,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
        /*
         *      MIP-SPI = HMAC-SSHA256(MIP-RK, "SPI CMIP PMIP");
         */
-       HMAC_CTX_init(&hmac);
        HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha256(), NULL);
        
        HMAC_Update(&hmac, (const uint8_t *) "SPI CMIP PMIP", 12);
@@ -304,7 +302,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
                 *      MN-HA-PMIP4 =
                 *         H(MIP-RK, "PMIP4 MN HA" | HA-IPv4 | MN-NAI);
                 */
-               HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL);
 
                HMAC_Update(&hmac, (const uint8_t *) "PMIP4 MN HA", 11);
@@ -356,7 +353,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
                 *      MN-HA-CMIP4 =
                 *         H(MIP-RK, "CMIP4 MN HA" | HA-IPv4 | MN-NAI);
                 */
-               HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL);
 
                HMAC_Update(&hmac, (const uint8_t *) "CMIP4 MN HA", 11);
@@ -408,7 +404,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
                 *      MN-HA-CMIP6 =
                 *         H(MIP-RK, "CMIP6 MN HA" | HA-IPv6 | MN-NAI);
                 */
-               HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL);
 
                HMAC_Update(&hmac, (const uint8_t *) "CMIP6 MN HA", 11);
@@ -457,7 +452,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
         */
        fa_rk = pairfind(request->reply->vps, WIMAX2ATTR(14));
        if (fa_rk && (fa_rk->length <= 1)) {
-               HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, mip_rk, rk_len, EVP_sha1(), NULL);
                
                HMAC_Update(&hmac, (const uint8_t *) "FA-RK", 5);
@@ -490,7 +484,6 @@ static int wimax_postauth(void *instance, REQUEST *request)
         */
        ip = pairfind(request->reply->vps, 1901);
        if (fa_rk && ip && mn_nai) {
-               HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, fa_rk->vp_octets, fa_rk->length,
                             EVP_sha1(), NULL);