Current webRTC spec https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-generatecertificate has a function for generating certificates that can be re-used on subsequent webRTC calls to the same site. This provides some additional identity and security management options which we leverage. This function is missing in Safari technology preview 33. You can verify this bug by browsing to https://pi.pe/iot/fclaim.html and seeing that the javascript console contains the following error: TypeError: RTCPeerConnection.generateCertificate is not a function. (In 'RTCPeerConnection.generateCertificate(certParams)', 'RTCPeerConnection.generateCertificate' is undefined)
<rdar://problem/32638029>
Note that generateCertificate should be complemented with persistent storage of certificates through IDB.
Created attachment 352053 [details] Patch
Attachment 352053 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:88: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Total errors found: 4 in 28 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 352058 [details] Patch
Attachment 352058 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 29 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 352093 [details] Patch
Attachment 352093 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 29 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 352093 [details] Patch Attachment 352093 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9543364 New failing tests: http/wpt/webrtc/generateCertificate.html
Created attachment 352110 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Comment on attachment 352093 [details] Patch Attachment 352093 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/9544056 New failing tests: http/wpt/webrtc/generateCertificate.html
Created attachment 352120 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Created attachment 352133 [details] Patch for landing
Attachment 352133 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:71: Omit int when using unsigned [runtime/unsigned] [1] Total errors found: 4 in 29 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 352299 [details] Rebasing
Attachment 352299 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 29 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 352299 [details] Rebasing Rejecting attachment 352299 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 352299, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Logging in as commit-queue@webkit.org... Fetching: https://bugs.webkit.org/attachment.cgi?id=352299&action=edit Fetching: https://bugs.webkit.org/show_bug.cgi?id=173541&ctype=xml&excludefield=attachmentdata Processing 1 patch from 1 bug. Processing patch 352299 from bug 173541. Fetching: https://bugs.webkit.org/attachment.cgi?id=352299 Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Parsed 29 diffs from patch file(s). patching file Source/ThirdParty/libwebrtc/ChangeLog patching file Source/WebCore/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. patching file Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp patching file Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp patching file Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp patching file Source/WebCore/CMakeLists.txt Hunk #2 succeeded at 308 (offset 1 line). patching file Source/WebCore/DerivedSources.make Hunk #1 succeeded at 231 (offset 1 line). patching file Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp patching file Source/WebCore/Modules/mediastream/PeerConnectionBackend.h patching file Source/WebCore/Modules/mediastream/RTCCertificate.cpp patching file Source/WebCore/Modules/mediastream/RTCCertificate.h patching file Source/WebCore/Modules/mediastream/RTCCertificate.idl patching file Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp patching file Source/WebCore/Modules/mediastream/RTCPeerConnection.h patching file Source/WebCore/Modules/mediastream/RTCPeerConnection.idl patching file Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp patching file Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h patching file Source/WebCore/Sources.txt Hunk #1 succeeded at 167 (offset 1 line). Hunk #2 succeeded at 184 (offset 1 line). Hunk #3 succeeded at 2882 (offset 2 lines). patching file Source/WebCore/WebCore.xcodeproj/project.pbxproj Hunk #1 succeeded at 7231 (offset 1 line). Hunk #2 succeeded at 15310 (offset 4 lines). Hunk #3 succeeded at 17107 (offset 4 lines). Hunk #4 FAILED at 27597. Hunk #5 FAILED at 27689. Hunk #6 FAILED at 27780. Hunk #7 FAILED at 28332. Hunk #8 FAILED at 30144. Hunk #9 FAILED at 31025. 6 out of 9 hunks FAILED -- saving rejects to file Source/WebCore/WebCore.xcodeproj/project.pbxproj.rej patching file Source/WebCore/bindings/js/WebCoreBuiltinNames.h Hunk #1 succeeded at 125 (offset 1 line). patching file Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp patching file Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h Hunk #1 succeeded at 47 (offset -1 lines). Hunk #2 succeeded at 112 (offset -1 lines). patching file LayoutTests/imported/w3c/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. patching file LayoutTests/http/wpt/webrtc/generateCertificate-expected.txt patching file LayoutTests/http/wpt/webrtc/generateCertificate.html patching file LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCCertificate-expected.txt patching file LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-generateCertificate-expected.txt patching file LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces.https-expected.txt patching file LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: https://webkit-queues.webkit.org/results/9582287
Created attachment 352332 [details] Rebasing
Attachment 352332 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 29 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 352332 [details] Rebasing Rejecting attachment 352332 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'build', '--no-clean', '--no-update', '--build-style=release', '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 5000 characters of output: LL -DENABLE_VIDEO -DENABLE_VIDEO_PRESENTATION_MODE -DENABLE_VIDEO_TRACK -DENABLE_VIDEO_USES_ELEMENT_FULLSCREEN -DENABLE_WEB_AUDIO -DENABLE_WEB_AUTHN -DENABLE_WEB_RTC -DENABLE_WEBGL -DENABLE_WEBGL2 -DENABLE_WEBMETAL -DENABLE_WIRELESS_PLAYBACK_TARGET -DENABLE_XSLT -DBUILDING_WEBKIT -DU_DISABLE_RENAMING=1 -DU_SHOW_CPLUSPLUS_API=0 -DGL_SILENCE_DEPRECATION=1 -DGLES_SILENCE_DEPRECATION=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.12 -g -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wno-sign-conversion -Winfinite-recursion -Wmove -iquote /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/WebCore-generated-files.hmap -I/Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/WebCore-own-target-headers.hmap -I/Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/WebCore-all-target-headers.hmap -iquote /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/WebCore-project-headers.hmap -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/include -IPAL -IForwardingHeaders -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxslt -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2 -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/DerivedSources/WebCore -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/WebKitAdditions -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include/WebKitAdditions -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/webrtc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include/webrtc -I/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/webrtc/sdk/objc/Framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include/webrtc/sdk/objc/Framework/Headers -I/Volumes/Data/EWS/WebKit/Source/WebCore -I/Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/DerivedSources/x86_64 -I/Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/DerivedSources -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wno-unknown-warning-option -F/Volumes/Data/EWS/WebKit/WebKitBuild/Release -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/System.framework/PrivateHeaders -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Carbon.framework/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Quartz.framework/Frameworks -include /Volumes/Data/EWS/WebKit/WebKitBuild/PrecompiledHeaders/WebCorePrefix-bttamgihfexolwdlczgjcnwpqezf/WebCorePrefix.h -MMD -MT dependencies -MF /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/UnifiedSource135.d --serialize-diagnostics /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/UnifiedSource135.dia -c /Volumes/Data/EWS/WebKit/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource135.cpp -o /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/UnifiedSource135.o ** BUILD FAILED ** The following build commands failed: CompileC /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/UnifiedSource132.o /Volumes/Data/EWS/WebKit/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource132.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Full output: https://webkit-queues.webkit.org/results/9587173
Created attachment 352348 [details] Rebasing
Attachment 352348 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 352358 [details] Rebasing
Attachment 352358 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:139: enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums. [readability/enum_casing] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:145: RSASSA_PKCS1_v1_5 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:150: ECDSA_P256 is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 352358 [details] Rebasing Clearing flags on attachment: 352358 Committed r237140: <https://trac.webkit.org/changeset/237140>
All reviewed patches have been landed. Closing bug.
The returned RTCCertificate isn't cloneable - which causes the following error when it is stored in indexedDb "Failed to store record in an IDBObjectStore: An object could not be cloned." Example/test page here https://pi.pe/p/genCertTest.html Tested in Release 68 (Safari 12.1, WebKit 14607.1.11) Tech preview
Tim, I am working on IDB support. In WebKit, we do that as a separate bug. Please file it if you can, otherwise I’ll do it. Thanks for the test page link! I’ll close this bug for now