hiero-ledger / hiero-ledger/hiero-sdk-cpp

[Beginner]: Rename `OpenSSLObjectWrapper` to neutral `CryptoObjectWrapper` and move out of `openssl_utils/`

Open
#1,614 6 comments 0 reactions 0 assignees View on GitHub
priority: low scope: core scope: crypto skill: beginner status: ready for dev
Dominant language
C++
Stars
42
Forks
108
Avg merge
11h 45m
Merged PRs (30d)
2

Description

### 🐥 Beginner Friendly

This issue is a great fit for contributors who are ready to explore the Hiero C++ codebase a little more and take on slightly more independent work.

Beginner Issues often involve reading existing C++ code, understanding how different parts of the SDK fit together, and making small, thoughtful updates that follow established patterns.

The goal is to support skill growth while keeping the experience approachable, well-scoped, and enjoyable.

> [!IMPORTANT]
> ### 🐥 About Beginner Issues
>
> Beginner Issues are a great next step for contributors who feel comfortable with the basic project workflow and want to explore the codebase a little more.
>
> These issues often involve:
> - Reading existing C++ code
> - Understanding how different parts of the SDK fit together
> - Making small, thoughtful updates that follow established patterns
>
> You'll usually see Beginner Issues focused on things like:
> - Small, well-scoped improvements to existing tests
> - Narrow updates to `src` functionality (e.g. refining helpers or improving readability)
> - Documentation or comment clarity
> - Enhancements to existing examples
>
> Other types of contributions — such as brand-new features, broader system changes, or deeper technical work — are just as valuable and may use different labels.

### 👾 Description of the Task

`OpenSSLObjectWrapper` is a generic RAII wrapper around C handles. PR #1595 introduced `Secp256k1Context.h` (which inherits from it) into `src/sdk/main/include/impl/openssl_utils/`, despite the wrapper not being OpenSSL-specific in any meaningful way and `Secp256k1Context` being a libsecp256k1 type, not an OpenSSL type.

The maintainer review on PR #1595 offered two paths and accepted the lighter one (a) on condition of a follow-up issue for the structural one (b):

> *"I'd take (b) — it's the right structural fit, and the rename is a sed-able change — but (a) is acceptable if you'd rather keep the diff small (a follow-up issue can be created to do (b))."*

This issue is option (b): rename the wrapper to a neutral name (`CryptoObjectWrapper` is the suggested name) and move it out of the `openssl_utils/` subdirectory so the relationship between the wrapper and OpenSSL stops being implied by directory layout.

Relevant files (touch list will fan out from here):

```
src/sdk/main/include/impl/openssl_utils/OpenSSLObjectWrapper.h -> rename + move
src/sdk/main/include/impl/ (new home)
all callers — every *.h / *.cc that #includes the wrapper or uses the type name
```

### 💡 Proposed Solution

1. Rename the type `OpenSSLObjectWrapper` to `CryptoObjectWrapper` everywhere it appears.
2. Move `OpenSSLObjectWrapper.h` from `src/sdk/main/include/impl/openssl_utils/` to a neutral location — probably `src/sdk/main/include/impl/CryptoObjectWrapper.h`. (Confirm during the work whether a `crypto_utils/` directory is wanted; the existing layout uses flat-in-impl, so flat is the safe default.)
3. Update every `#include` and every type reference (`OpenSSLObjectWrapper<...>` → `CryptoObjectWrapper<...>`).
4. Update CMake glob patterns / explicit file lists if any list `openssl_utils/OpenSSLObjectWrapper.h` by path.
5. Run `clang-format-17` and the full unit suite.

The wrapper's behavior must not change — this is a rename + move, not a redesign.

### 👩‍💻 Implementation Steps

- [ ] Open [src/sdk/main/include/impl/openssl_utils/OpenSSLObjectWrapper.h](../../src/sdk/main/include/impl/openssl_utils/OpenSSLObjectWrapper.h) and confirm the wrapper is generic over its handle type and does not depend on any OpenSSL header itself.
- [ ] Find every reference: `grep -rn "OpenSSLObjectWrapper" src/`.
- [ ] Move the file to its new home (likely `src/sdk/main/include/impl/CryptoObjectWrapper.h`) and rename the class inside.
- [ ] Update every `#include "impl/openssl_utils/OpenSSLObjectWrapper.h"` to the new path.
- [ ] Replace every `OpenSSLObjectWrapper` with `CryptoObjectWrapper` (a single sed-style replacement is fine — verify the diff before committing).
- [ ] Inspect any CMakeLists / glob lists / install lists that mention the file by name and update them.
- [ ] Build with `cmake --build --preset linux-x64-debug -j 6`.
- [ ] Run the unit suite: `ctest -j 6 -C Debug --test-dir build/linux-x64-debug`.
- [ ] Run `clang-format-17` against any file you touched.

### ✅ Acceptance Criteria

- [ ] No reference to `OpenSSLObjectWrapper` remains anywhere under `src/`.
- [ ] The wrapper header lives outside `impl/openssl_utils/`.
- [ ] All callers — including `Secp256k1Context.h` from PR #1595 — compile against `CryptoObjectWrapper`.
- [ ] No behavior change. Unit tests still pass.
- [ ] CMake builds cleanly on at least one configured preset (preferably `linux-x64-debug`).

---

### 📋 Step-by-Step Contribution Guide

To help keep contributions consistent and easy to review, we recommend following these steps:

- [ ] Comment `/assign` to request the issue
- [ ] Wait for assignment
- [ ] Fork the repository and create a branch
- [ ] Set up the project using the instructions in `README.md`
- [ ] Make the requested changes
- [ ] Sign each commit using `-s -S`
- [ ] Push your branch and open a pull request

Read [Workflow Guide](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/docs/training/workflow.md) for step-by-step workflow guidance.
Read [README.md](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/README.md) for setup instructions.

❗ Pull requests **cannot be merged** without `S` and `s` signed commits.
See the [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/docs/training/signing.md).

### 🤔 Additional Information

- Originating PR: [#1595](https://github.com/hiero-ledger/hiero-sdk-cpp/pull/1595).
- This is mostly a sed-able rename. The diff will look big in line-count terms (one line per `#include` site) but each line is mechanical. Keep the PR scoped — no other refactoring while you're in here.
- If on inspection a different neutral name reads better than `CryptoObjectWrapper` (e.g. `CHandleWrapper`, `RaiiHandle`), feel free to use it — note the choice in the PR description.

If you have questions while working on this issue, feel free to ask! [Hiero-SDK-C++ Discord](https://discord.com/channels/905194001349627914/1337424839761465364)

Contributor guide

Open the contributing guide

Research direction

Start with src/sdk/main/include/impl/openssl_utils/OpenSSLObjectWrapper.h and run grep -rn "OpenSSLObjectWrapper" src/ to map callers, includes, and build references. Move and rename the header, update all references and any CMake lists, then run cmake --build --preset linux-x64-debug -j 6 and ctest -j 6 -C Debug --test-dir build/linux-x64-debug; done means no old name remains under src and the suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, cryptography
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.