@@ -265,7 +265,7 @@ static int32_t cryptography_encrypt(uint8_t *data_out, size_t len_data_out, uint
265
265
266
266
if (sa_ptr -> ek_ref [0 ] == '\0' )
267
267
{
268
- status = CRYPTOGRAHPY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
268
+ status = CRYPTOGRAPHY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
269
269
return status ;
270
270
}
271
271
@@ -342,7 +342,7 @@ static int32_t cryptography_encrypt(uint8_t *data_out, size_t len_data_out, uint
342
342
// Find the 'base64ciphertext' token
343
343
if (parse_result < 0 )
344
344
{
345
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
345
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
346
346
printf ("Failed to parse JSON: %d\n" , parse_result );
347
347
return status ;
348
348
}
@@ -444,7 +444,7 @@ static int32_t cryptography_encrypt(uint8_t *data_out, size_t len_data_out, uint
444
444
#endif
445
445
if (http_code != 200 )
446
446
{
447
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
447
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
448
448
fprintf (stderr , "KMC Crypto Failure Response:\n%s\n" , chunk_write -> response );
449
449
return status ;
450
450
}
@@ -455,7 +455,7 @@ static int32_t cryptography_encrypt(uint8_t *data_out, size_t len_data_out, uint
455
455
}
456
456
if (ciphertext_found == CRYPTO_FALSE )
457
457
{
458
- status = CRYPTOGRAHPY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
458
+ status = CRYPTOGRAPHY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
459
459
return status ;
460
460
}
461
461
@@ -514,7 +514,7 @@ static int32_t cryptography_decrypt(uint8_t *data_out, size_t len_data_out, uint
514
514
515
515
if (sa_ptr -> ek_ref [0 ] == '\0' )
516
516
{
517
- status = CRYPTOGRAHPY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
517
+ status = CRYPTOGRAPHY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
518
518
return status ;
519
519
}
520
520
@@ -585,7 +585,7 @@ static int32_t cryptography_decrypt(uint8_t *data_out, size_t len_data_out, uint
585
585
// Find the 'base64ciphertext' token
586
586
if (parse_result < 0 )
587
587
{
588
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
588
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
589
589
printf ("Failed to parse JSON: %d\n" , parse_result );
590
590
return status ;
591
591
}
@@ -631,7 +631,7 @@ static int32_t cryptography_decrypt(uint8_t *data_out, size_t len_data_out, uint
631
631
#endif
632
632
if (http_code != 200 )
633
633
{
634
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
634
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
635
635
fprintf (stderr , "KMC Crypto Failure Response:\n%s\n" , chunk_write -> response );
636
636
return status ;
637
637
}
@@ -642,7 +642,7 @@ static int32_t cryptography_decrypt(uint8_t *data_out, size_t len_data_out, uint
642
642
}
643
643
if (ciphertext_found == CRYPTO_FALSE )
644
644
{
645
- status = CRYPTOGRAHPY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
645
+ status = CRYPTOGRAPHY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
646
646
return status ;
647
647
}
648
648
@@ -715,7 +715,7 @@ static int32_t cryptography_authenticate(uint8_t *data_out, size_t len_data_out,
715
715
716
716
if (sa_ptr -> ak_ref [0 ] == '\0' )
717
717
{
718
- status = CRYPTOGRAHPY_KMC_NULL_AUTHENTICATION_KEY_REFERENCE_IN_SA ;
718
+ status = CRYPTOGRAPHY_KMC_NULL_AUTHENTICATION_KEY_REFERENCE_IN_SA ;
719
719
return status ;
720
720
}
721
721
@@ -782,7 +782,7 @@ static int32_t cryptography_authenticate(uint8_t *data_out, size_t len_data_out,
782
782
// Find the 'integrityCheckValue' token
783
783
if (parse_result < 0 )
784
784
{
785
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
785
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
786
786
printf ("Failed to parse JSON: %d\n" , parse_result );
787
787
return status ;
788
788
}
@@ -829,7 +829,7 @@ static int32_t cryptography_authenticate(uint8_t *data_out, size_t len_data_out,
829
829
metadata += comma_idx + 1 ;
830
830
if (metadata >= metadata_end )
831
831
{
832
- status = CRYPTOGRAHPY_KMC_ICV_NOT_FOUND_IN_JSON_RESPONSE ;
832
+ status = CRYPTOGRAPHY_KMC_ICV_NOT_FOUND_IN_JSON_RESPONSE ;
833
833
return status ;
834
834
}
835
835
}
@@ -865,7 +865,7 @@ static int32_t cryptography_authenticate(uint8_t *data_out, size_t len_data_out,
865
865
#endif
866
866
if (http_code != 200 )
867
867
{
868
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
868
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
869
869
fprintf (stderr , "KMC Crypto Failure Response:\n%s\n" , chunk_write -> response );
870
870
return status ;
871
871
}
@@ -876,7 +876,7 @@ static int32_t cryptography_authenticate(uint8_t *data_out, size_t len_data_out,
876
876
}
877
877
if (icvtext_found == CRYPTO_FALSE )
878
878
{
879
- status = CRYPTOGRAHPY_KMC_ICV_NOT_FOUND_IN_JSON_RESPONSE ;
879
+ status = CRYPTOGRAPHY_KMC_ICV_NOT_FOUND_IN_JSON_RESPONSE ;
880
880
return status ;
881
881
}
882
882
@@ -954,7 +954,7 @@ static int32_t cryptography_validate_authentication(uint8_t *data_out, size_t le
954
954
955
955
if (sa_ptr -> ak_ref [0 ] == '\0' )
956
956
{
957
- status = CRYPTOGRAHPY_KMC_NULL_AUTHENTICATION_KEY_REFERENCE_IN_SA ;
957
+ status = CRYPTOGRAPHY_KMC_NULL_AUTHENTICATION_KEY_REFERENCE_IN_SA ;
958
958
return status ;
959
959
}
960
960
@@ -1029,7 +1029,7 @@ static int32_t cryptography_validate_authentication(uint8_t *data_out, size_t le
1029
1029
1030
1030
if (parse_result < 0 )
1031
1031
{
1032
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1032
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1033
1033
printf ("Failed to parse JSON: %d\n" , parse_result );
1034
1034
return status ;
1035
1035
}
@@ -1056,7 +1056,7 @@ static int32_t cryptography_validate_authentication(uint8_t *data_out, size_t le
1056
1056
#endif
1057
1057
if (http_code != 200 )
1058
1058
{
1059
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1059
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1060
1060
fprintf (stderr , "KMC Crypto Generic Failure Response:\n%s\n" , chunk_write -> response );
1061
1061
return status ;
1062
1062
}
@@ -1081,7 +1081,7 @@ static int32_t cryptography_validate_authentication(uint8_t *data_out, size_t le
1081
1081
#endif
1082
1082
if (strcmp (result_str , "true" ) != 0 ) // KMC crypto service returns true string if ICV check succeeds.
1083
1083
{
1084
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_MAC_VALIDATION_ERROR ;
1084
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_MAC_VALIDATION_ERROR ;
1085
1085
fprintf (stderr , "KMC Crypto MAC Validation Failure Response:\n%s\n" , chunk_write -> response );
1086
1086
return status ;
1087
1087
}
@@ -1090,7 +1090,7 @@ static int32_t cryptography_validate_authentication(uint8_t *data_out, size_t le
1090
1090
}
1091
1091
if (http_status_found == CRYPTO_FALSE )
1092
1092
{
1093
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1093
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1094
1094
fprintf (stderr , "KMC Crypto Generic Failure Response:\n%s\n" , chunk_write -> response );
1095
1095
return status ;
1096
1096
}
@@ -1138,7 +1138,7 @@ static int32_t cryptography_aead_encrypt(uint8_t *data_out, size_t len_data_out,
1138
1138
1139
1139
if (sa_ptr -> ek_ref [0 ] == '\0' )
1140
1140
{
1141
- status = CRYPTOGRAHPY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
1141
+ status = CRYPTOGRAPHY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
1142
1142
free (iv_base64 );
1143
1143
return status ;
1144
1144
}
@@ -1297,7 +1297,7 @@ static int32_t cryptography_aead_encrypt(uint8_t *data_out, size_t len_data_out,
1297
1297
// Find the 'base64ciphertext' token
1298
1298
if (parse_result < 0 )
1299
1299
{
1300
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1300
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1301
1301
printf ("Failed to parse JSON: %d\n" , parse_result );
1302
1302
if (iv_base64 != NULL )
1303
1303
free (iv_base64 );
@@ -1409,7 +1409,7 @@ static int32_t cryptography_aead_encrypt(uint8_t *data_out, size_t len_data_out,
1409
1409
#endif
1410
1410
if (http_code != 200 )
1411
1411
{
1412
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1412
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1413
1413
fprintf (stderr , "KMC Crypto Failure Response:\n%s\n" , chunk_write -> response );
1414
1414
if (iv_base64 != NULL )
1415
1415
free (iv_base64 );
@@ -1435,7 +1435,7 @@ static int32_t cryptography_aead_encrypt(uint8_t *data_out, size_t len_data_out,
1435
1435
}
1436
1436
if (ciphertext_found == CRYPTO_FALSE )
1437
1437
{
1438
- status = CRYPTOGRAHPY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
1438
+ status = CRYPTOGRAPHY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
1439
1439
if (encrypt_uri != NULL )
1440
1440
free (encrypt_uri );
1441
1441
if (iv_base64 != NULL )
@@ -1548,7 +1548,7 @@ static int32_t cryptography_aead_decrypt(uint8_t *data_out, size_t len_data_out,
1548
1548
1549
1549
if (sa_ptr -> ek_ref [0 ] == '\0' )
1550
1550
{
1551
- status = CRYPTOGRAHPY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
1551
+ status = CRYPTOGRAPHY_KMC_NULL_ENCRYPTION_KEY_REFERENCE_IN_SA ;
1552
1552
return status ;
1553
1553
}
1554
1554
@@ -1683,7 +1683,7 @@ static int32_t cryptography_aead_decrypt(uint8_t *data_out, size_t len_data_out,
1683
1683
// Find the 'base64ciphertext' token
1684
1684
if (parse_result < 0 )
1685
1685
{
1686
- status = CRYPTOGRAHPY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1686
+ status = CRYPTOGRAPHY_KMC_CRYPTO_JSON_PARSE_ERROR ;
1687
1687
printf ("Failed to parse JSON: %d\n" , parse_result );
1688
1688
free (decrypt_payload );
1689
1689
free (decrypt_uri );
@@ -1732,7 +1732,7 @@ static int32_t cryptography_aead_decrypt(uint8_t *data_out, size_t len_data_out,
1732
1732
#endif
1733
1733
if (http_code != 200 )
1734
1734
{
1735
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1735
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
1736
1736
fprintf (stderr , "KMC Crypto Failure Response:\n%s\n" , chunk_write -> response );
1737
1737
free (chunk_read );
1738
1738
free (chunk_write );
@@ -1749,7 +1749,7 @@ static int32_t cryptography_aead_decrypt(uint8_t *data_out, size_t len_data_out,
1749
1749
}
1750
1750
if (ciphertext_found == CRYPTO_FALSE )
1751
1751
{
1752
- status = CRYPTOGRAHPY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
1752
+ status = CRYPTOGRAPHY_KMC_CIPHER_TEXT_NOT_FOUND_IN_JSON_RESPONSE ;
1753
1753
free (chunk_read );
1754
1754
free (chunk_write );
1755
1755
free (cleartext_base64 );
@@ -2133,15 +2133,15 @@ int32_t curl_response_error_check(CURL *curl_handle, char *response)
2133
2133
}
2134
2134
else // CAM not enabled, but cam is configured and 302 received -- likely misconfiguration!
2135
2135
{
2136
- response_status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2136
+ response_status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2137
2137
return response_status ;
2138
2138
}
2139
2139
}
2140
2140
}
2141
2141
2142
2142
if (response_code != 200 ) // unhandled error case
2143
2143
{
2144
- response_status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2144
+ response_status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2145
2145
return response_status ;
2146
2146
}
2147
2147
@@ -2151,7 +2151,7 @@ int32_t curl_response_error_check(CURL *curl_handle, char *response)
2151
2151
2152
2152
if (response == NULL ) // No response, possibly because service is CAM secured.
2153
2153
{
2154
- response_status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_EMPTY_RESPONSE ;
2154
+ response_status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_EMPTY_RESPONSE ;
2155
2155
fprintf (stderr , "curl_easy_perform() unexpected empty response: \n%s\n" ,
2156
2156
"Empty Crypto Service response can be caused by CAM security, is CAM configured?" );
2157
2157
return response_status ;
@@ -2174,7 +2174,7 @@ int32_t curl_perform_with_cam_retries(CURL *curl_handle, memory_write *chunk_wri
2174
2174
2175
2175
if (res != CURLE_OK ) // This is not a response w/return code, this is something breaking!
2176
2176
{
2177
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2177
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_GENERIC_FAILURE ;
2178
2178
fprintf (stderr , "curl_easy_perform() failed: %s\n" , curl_easy_strerror (res ));
2179
2179
break ; // Go to Post retry loop cleanup and return status.
2180
2180
}
@@ -2227,7 +2227,7 @@ int32_t curl_perform_with_cam_retries(CURL *curl_handle, memory_write *chunk_wri
2227
2227
if (status == CRYPTO_LIB_SUCCESS &&
2228
2228
chunk_write -> response == NULL ) // no error case detected, but invalid NULL response!
2229
2229
{
2230
- status = CRYPTOGRAHPY_KMC_CRYPTO_SERVICE_EMPTY_RESPONSE ;
2230
+ status = CRYPTOGRAPHY_KMC_CRYPTO_SERVICE_EMPTY_RESPONSE ;
2231
2231
}
2232
2232
return status ;
2233
2233
}
0 commit comments