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

Fix test 17 error on build #1011

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions base/src/test/java/org/mozilla/jss/tests/TestRawSSL.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.mozilla.jss.tests;

import org.mozilla.jss.CryptoManager;
import org.mozilla.jss.nss.PR;
import org.mozilla.jss.nss.PRFDProxy;
import org.mozilla.jss.nss.SSL;
Expand Down Expand Up @@ -27,15 +28,15 @@ public static void TestSSLOptions() throws Exception {
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert(ssl_fd != null);

// 8 == SSL_ENABLE_SSL3; disable it
assert(SSL.OptionSet(ssl_fd, 8, 0) == SSL.SECSuccess);
// 9 == SSL_NO_CACHE; disable it
assert(SSL.OptionSet(ssl_fd, 9, 0) == SSL.SECSuccess);

// Validate that the set worked.
assert(SSL.OptionGet(ssl_fd, 8) == SSL.SECSuccess);
assert(SSL.OptionGet(ssl_fd, 9) == SSL.SECSuccess);

// Renable SSL_ENABLE_SSL3 and validate it worked
assert(SSL.OptionSet(ssl_fd, 8, 1) == SSL.SECSuccess);
assert(SSL.OptionGet(ssl_fd, 8) == 1);
// Renable SSL_NO_CACHE and validate it worked
assert(SSL.OptionSet(ssl_fd, 9, 1) == SSL.SECSuccess);
assert(SSL.OptionGet(ssl_fd, 9) == 1);

// Ensure that setting an invalid option fails
assert(SSL.OptionSet(ssl_fd, 799999, 0) != SSL.SECSuccess);
Expand Down Expand Up @@ -160,7 +161,7 @@ public static void main(String[] args) throws Exception {
System.out.println("Usage: TestRawSSL /path/to/nssdb");
System.exit(1);
}

CryptoManager cm = CryptoManager.getInstance();
System.out.println("Calling TestSSLImportFD()...");
TestSSLImportFD();

Expand Down
Loading