Fix indentation

This commit is contained in:
M. Mert Yildiran 2022-06-08 04:32:18 +03:00
parent 49d95d03d3
commit 93bbf9dedc
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A

View File

@ -46,20 +46,20 @@ static int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) {
__u64 pid_tgid = bpf_get_current_pid_tgid();
__u64 pid = pid_tgid >> 32;
if (!should_tap(pid)) {
return 0;
}
return 0;
}
struct ssl_info info = lookup_ssl_info(ctx, &ssl_write_context, pid_tgid);
struct ssl_info info = lookup_ssl_info(ctx, &ssl_write_context, pid_tgid);
// TODO: Try to make these architecture independent using macros
info.buffer_len = ctx->rcx;
info.buffer = (void*)ctx->rbx;
info.buffer_len = ctx->rcx;
info.buffer = (void*)ctx->rbx;
long err = bpf_map_update_elem(&ssl_write_context, &pid_tgid, &info, BPF_ANY);
if (err != 0) {
log_error(ctx, LOG_ERROR_PUTTING_SSL_CONTEXT, pid_tgid, err, 0l);
}
if (err != 0) {
log_error(ctx, LOG_ERROR_PUTTING_SSL_CONTEXT, pid_tgid, err, 0l);
}
output_ssl_chunk(ctx, &info, info.buffer_len, pid_tgid, 0);
@ -71,8 +71,8 @@ static int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
__u64 pid_tgid = bpf_get_current_pid_tgid();
__u64 pid = pid_tgid >> 32;
if (!should_tap(pid)) {
return 0;
}
return 0;
}
void* stack_addr = (void*)ctx->rsp;
__u64 data_p;
@ -83,17 +83,17 @@ static int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
return 0;
}
struct ssl_info info = lookup_ssl_info(ctx, &ssl_read_context, pid_tgid);
struct ssl_info info = lookup_ssl_info(ctx, &ssl_read_context, pid_tgid);
// TODO: Try to make these architecture independent using macros
info.buffer_len = ctx->rcx;
info.buffer = (void*)data_p;
info.buffer_len = ctx->rcx;
info.buffer = (void*)data_p;
long err = bpf_map_update_elem(&ssl_read_context, &pid_tgid, &info, BPF_ANY);
if (err != 0) {
log_error(ctx, LOG_ERROR_PUTTING_SSL_CONTEXT, pid_tgid, err, 0l);
}
if (err != 0) {
log_error(ctx, LOG_ERROR_PUTTING_SSL_CONTEXT, pid_tgid, err, 0l);
}
output_ssl_chunk(ctx, &info, info.buffer_len, pid_tgid, FLAGS_IS_READ_BIT);