Skip to content

Commit

Permalink
fix code identation
Browse files Browse the repository at this point in the history
  • Loading branch information
wuriyanto48 committed Aug 31, 2023
1 parent a3cd0d3 commit 8b17dcd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
5 changes: 3 additions & 2 deletions crypsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,9 @@ static int crypsi_aes_gcm_encrypt(enum crypsi_aes_key aes_key_size, const unsign
return ret;
}

if((dst_tmp_raw = (unsigned char*) malloc(raw_ciphertext_len)) == NULL)
return -1;
if((dst_tmp_raw = (unsigned char*) malloc(raw_ciphertext_len)) == NULL) {
return -1;
}

if(!(ctx = EVP_CIPHER_CTX_new())) {
goto cleanup;
Expand Down
44 changes: 22 additions & 22 deletions crypsi_mysqludf.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ char* mcrypsi_aes_128_gcm_encrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_128_gcm_encrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_128_gcm_encrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -204,8 +204,8 @@ char* mcrypsi_aes_128_gcm_decrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_128_gcm_decrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_128_gcm_decrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -248,8 +248,8 @@ char* mcrypsi_aes_192_gcm_encrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_192_gcm_encrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_192_gcm_encrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -292,8 +292,8 @@ char* mcrypsi_aes_192_gcm_decrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_192_gcm_decrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_192_gcm_decrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -336,8 +336,8 @@ char* mcrypsi_aes_256_gcm_encrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_256_gcm_encrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_256_gcm_encrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -380,8 +380,8 @@ char* mcrypsi_aes_256_gcm_decrypt(UDF_INIT* initid, UDF_ARGS* args, char* result
ret = crypsi_aes_256_gcm_decrypt(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error encrypt with mcrypsi_aes_256_gcm_decrypt");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -424,8 +424,8 @@ char* mcrypsi_hmac_md5(UDF_INIT* initid, UDF_ARGS* args, char* result,
ret = crypsi_hmac_md5(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error execute mcrypsi_hmac_md5");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -468,8 +468,8 @@ char* mcrypsi_hmac_sha1(UDF_INIT* initid, UDF_ARGS* args, char* result,
ret = crypsi_hmac_sha1(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error execute mcrypsi_hmac_sha1");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -512,8 +512,8 @@ char* mcrypsi_hmac_sha256(UDF_INIT* initid, UDF_ARGS* args, char* result,
ret = crypsi_hmac_sha256(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error execute mcrypsi_hmac_sha256");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -556,8 +556,8 @@ char* mcrypsi_hmac_sha384(UDF_INIT* initid, UDF_ARGS* args, char* result,
ret = crypsi_hmac_sha384(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error execute mcrypsi_hmac_sha384");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down Expand Up @@ -600,8 +600,8 @@ char* mcrypsi_hmac_sha512(UDF_INIT* initid, UDF_ARGS* args, char* result,
ret = crypsi_hmac_sha512(input_key, input_text, text_size, &dst, &dst_size);
if (ret != 0) {
strcpy(error, "error execute mcrypsi_hmac_sha512");
*is_null = 1;
return NULL;
*is_null = 1;
return NULL;
}

*length = dst_size;
Expand Down

0 comments on commit 8b17dcd

Please sign in to comment.