Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all Certificate Fingerprint Algorithms #1077

Merged

Conversation

Sean-Der
Copy link
Contributor

Before was hardcoded to sha256

Resolves #1076

@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch 9 times, most recently from f8ee467 to 0b9456a Compare December 22, 2023 03:52
@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch 3 times, most recently from cacf5fd to 0e02e5a Compare December 30, 2023 01:14
@Sean-Der
Copy link
Contributor Author

This PR look ok @paullouisageneau ?

Anything I can do to make it easier to merge/test/use?

@Sean-Der
Copy link
Contributor Author

Sean-Der commented Jan 4, 2024

@paullouisageneau I shared builds of OBS with this patch and testers have confirmed it fixes the issue obsproject/obs-studio#9800 (comment) !

Copy link
Owner

@paullouisageneau paullouisageneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding the feature!

While it works, I think there are some architectural issues with the proposed API. I think the FingerprintAlgorithm enum should actually be defined in Certificate, it doesn't really belong in Description. Also, carrying algorithm and digest separately side-by-side feels like a cumbersome design.

It could make sense to introduce Certificate::Fingerprint like this instead:

struct Fingerprint {
    enum Algorithm { Sha1, Sha224, Sha256, Sha384, Sha512 };
    static string AlgorithmIdentifier(Algorithm algorithm);
    static size_t AlgorithmSize(Algorithm algorithm);

    Algorithm algorithm;
    string value;
};

What do you think?

src/description.cpp Outdated Show resolved Hide resolved
include/rtc/description.hpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
@Sean-Der
Copy link
Contributor Author

Sean-Der commented Jan 6, 2024

Looks great to me! I can implement this tonight.

Certificate isn't part of the public API. Where should I put Certificate::Fingerprint instead?

@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch 4 times, most recently from 5fc100a to 5052f37 Compare January 7, 2024 02:35
@paullouisageneau
Copy link
Owner

Certificate isn't part of the public API. Where should I put Certificate::Fingerprint instead?

Uh yes, my bad, sorry. I'd like to expose it but it isn't part of the public API currently. You could put it as CertificateFingerprint in include/rtc/description.hpp outside of Description for now.

@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch 2 times, most recently from 2742626 to 1816165 Compare January 8, 2024 02:15
@Sean-Der
Copy link
Contributor Author

Sean-Der commented Jan 8, 2024

@paullouisageneau I believe I have updated everything. Could I get another review? thanks!

src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/impl/certificate.hpp Outdated Show resolved Hide resolved
include/rtc/description.hpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
src/impl/certificate.cpp Outdated Show resolved Hide resolved
src/impl/peerconnection.cpp Outdated Show resolved Hide resolved
@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch from 1ef68d5 to e167ed6 Compare January 8, 2024 16:03
@Sean-Der
Copy link
Contributor Author

Sean-Der commented Jan 8, 2024

@paullouisageneau I have addressed all the comments. Can I get another review please. thank you!

Copy link
Owner

@paullouisageneau paullouisageneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few nitpicks, after that it looks good to me, thanks!

src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
src/impl/peerconnection.cpp Outdated Show resolved Hide resolved
src/description.cpp Outdated Show resolved Hide resolved
Before was hardcoded to sha256

Resolves paullouisageneau#1076

Co-authored-by: Paul-Louis Ageneau <[email protected]>
@Sean-Der Sean-Der force-pushed the certificate-fingerprint branch from 2c9827e to 42ec088 Compare January 9, 2024 16:03
@Sean-Der
Copy link
Contributor Author

Sean-Der commented Jan 9, 2024

@paullouisageneau done!

Copy link
Owner

@paullouisageneau paullouisageneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, it looks good to me now!

@paullouisageneau paullouisageneau merged commit 143a44d into paullouisageneau:master Jan 10, 2024
11 checks passed
@Sean-Der Sean-Der deleted the certificate-fingerprint branch January 10, 2024 16:56
@Sean-Der
Copy link
Contributor Author

huzzah! Thank you @paullouisageneau

Could I also get a tag? This closes out all OBS bugs, will be nice to see them all gone :)

@paullouisageneau
Copy link
Owner

Would it be possible to wait a few days for a 0.20.0 release? This PR breaks ABI (because of the field change in public-facing Description class) so it can't be released on 0.19. Of course I could set a 0.20.0-alpha tag, but wouldn't it be an issue for the packetizers of OBS?

@Sean-Der
Copy link
Contributor Author

@paullouisageneau yea! No rush I also need to get CMake change in

sorry for the churn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support all Certificate Fingerprint Algos
2 participants