test: remove TODOs
authorPauli <pauli@openssl.org>
Mon, 31 May 2021 04:27:31 +0000 (14:27 +1000)
committerPauli <pauli@openssl.org>
Wed, 2 Jun 2021 06:30:15 +0000 (16:30 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15539)

test/algorithmid_test.c
test/bntest.c
test/cmp_asn_test.c
test/cmp_client_test.c
test/cmp_hdr_test.c
test/helpers/handshake.c
test/helpers/pkcs12.c
test/ssl_old_test.c
test/sslapitest.c

index b484315ad36a24ccad777c74366f33480c63e5cc..ce5fbffc2230a26a877f171f2ec0077f419d3159 100644 (file)
@@ -107,16 +107,6 @@ static int test_x509_spki_aid(X509 *cert, const char *filename)
     return test_spki_aid(pubkey, filename);
 }
 
-/*
- * TODO
- * When we gain the ability to get an EVP_SIGNATURE with a complete signature
- * algorithm name (like "sha1WithRSAEncryption" or its corresponding OID in
- * text form, "1.2.840.113549.1.1.2"), we won't have to limit this test to
- * what we have in libcrypto's cross-reference db, i.e. won't have to call
- * OBJ_find_sigid_algs() to find out the EVP_PKEY_METHOD NID any more.
- * All we'd have to do is used OBJ_obj2txt() on an ASN1_OBJECT and pass the
- * result.
- */
 static int test_x509_sig_aid(X509 *eecert, const char *ee_filename,
                              X509 *cacert, const char *ca_filename)
 {
index b6147395fd2536cf11b744091c4b393f4bbc2e82..c90db8f8e4605da25a7cefb35465889307b12004 100644 (file)
@@ -28,7 +28,7 @@
 #endif
 
 /*
- * Things in boring, not in openssl.  TODO we should add them.
+ * Things in boring, not in openssl.
  */
 #define HAVE_BN_PADDED 0
 #define HAVE_BN_SQRT 0
@@ -1100,7 +1100,7 @@ static int file_sum(STANZA *s)
     /*
      * Test that the functions work when |r| and |a| point to the same BIGNUM,
      * or when |r| and |b| point to the same BIGNUM.
-     * TODO: Test where all of |r|, |a|, and |b| point to the same BIGNUM.
+     * There is no test for all of |r|, |a|, and |b| pointint to the same BIGNUM.
      */
     if (!TEST_true(BN_copy(ret, a))
             || !TEST_true(BN_add(ret, ret, b))
@@ -1127,7 +1127,6 @@ static int file_sum(STANZA *s)
      * documented as having. Note that these functions are frequently used
      * when the prerequisites don't hold. In those cases, they are supposed
      * to work as if the prerequisite hold, but we don't test that yet.
-     * TODO: test that.
      */
     if (!BN_is_negative(a) && !BN_is_negative(b) && BN_cmp(a, b) >= 0) {
         if (!TEST_true(BN_uadd(ret, a, b))
@@ -1140,7 +1139,8 @@ static int file_sum(STANZA *s)
         /*
          * Test that the functions work when |r| and |a| point to the same
          * BIGNUM, or when |r| and |b| point to the same BIGNUM.
-         * TODO: Test where all of |r|, |a|, and |b| point to the same BIGNUM.
+         * There is no test for all of |r|, |a|, and |b| pointint to the same
+         * BIGNUM.
          */
         if (!TEST_true(BN_copy(ret, a))
                 || !TEST_true(BN_uadd(ret, ret, b))
index 24f6605ce9babc61387651c996ded416470e9477..36ae8a60087be7e1f227bbcca40c716b2ebf062d 100644 (file)
@@ -117,10 +117,5 @@ int setup_tests(void)
     ADD_TEST(test_cmp_asn1_get_int);
     ADD_TEST(test_ASN1_OCTET_STRING_set);
     ADD_TEST(test_ASN1_OCTET_STRING_set_tgt_is_src);
-    /*
-     * TODO make sure that total number of tests (here currently 24) is shown,
-     * also for other cmp_*text.c. Currently the test drivers always show 1.
-     */
-
     return 1;
 }
index d181a03d19fbfef83160a3ba7f6326ec6710a01b..863a765886777672aa124b8b7a29f2ebae82387d 100644 (file)
@@ -101,7 +101,6 @@ static int execute_exec_GENM_ses_test(CMP_SES_TEST_FIXTURE *fixture)
     if (!TEST_ptr(itavs = OSSL_CMP_exec_GENM_ses(fixture->cmp_ctx)))
         return 0;
     sk_OSSL_CMP_ITAV_pop_free(itavs, OSSL_CMP_ITAV_free);
-    /* TODO: check if the returned value is the expected one (same as sent) */
     return 1;
 }
 
@@ -115,7 +114,6 @@ static int execute_exec_certrequest_ses_test(CMP_SES_TEST_FIXTURE *fixture)
 
     if (!TEST_ptr(res) || !TEST_int_eq(X509_cmp(res, client_cert), 0))
         return 0;
-    /* TODO: check that cerfConf has been exchanged unless implicitConfirm */
     if (fixture->caPubs != NULL) {
         STACK_OF(X509) *caPubs = OSSL_CMP_CTX_get1_caPubs(fixture->cmp_ctx);
         int ret = TEST_int_eq(STACK_OF_X509_cmp(fixture->caPubs, caPubs), 0);
@@ -169,7 +167,6 @@ static int test_exec_IR_ses_poll(void)
     ossl_cmp_mock_srv_set_pollCount(fixture->srv_ctx, 2);
     ossl_cmp_mock_srv_set_checkAfterTime(fixture->srv_ctx, checkAfter);
     EXECUTE_TEST(execute_exec_certrequest_ses_test, tear_down);
-    /* TODO: check that 2 rounds are done or session takes 2..3 seconds */
     return result;
 }
 
index ce0038d596484af48f48f9822fcd3e4905478b53..f4bc65bb9e9e5843395c106fced16e009a2a41f4 100644 (file)
@@ -480,10 +480,5 @@ int setup_tests(void)
     /* also tests internal function ossl_cmp_hdr_get_pvno(): */
     ADD_TEST(test_HDR_init_with_ref);
     ADD_TEST(test_HDR_init_with_subject);
-    /*
-     *  TODO make sure that total number of tests (here currently 24) is shown,
-     *  also for other cmp_*text.c. Currently the test drivers always show 1.
-     */
-
     return 1;
 }
index 97255306da1dccb01a00a3ea03760c224ce78253..0543634c73d48f7266200b2f7f17947f880f5300 100644 (file)
@@ -1196,13 +1196,7 @@ static handshake_status_t handshake_status(peer_status_t last_status,
             /* The client failed immediately before sending the ClientHello */
             return client_spoke_last ? CLIENT_ERROR : INTERNAL_ERROR;
         case PEER_SUCCESS:
-            /*
-             * First peer succeeded but second peer errored.
-             * TODO(emilia): we should be able to continue here (with some
-             * application data?) to ensure the first peer receives the
-             * alert / close_notify.
-             * (No tests currently exercise this branch.)
-             */
+            /* First peer succeeded but second peer errored. */
             return client_spoke_last ? CLIENT_ERROR : SERVER_ERROR;
         case PEER_RETRY:
             /* We errored; let the peer finish. */
index ab877bca0050e33d944577628747505ab37a796c..cb94be7b883bcb8a7b4fc513bb5be5e8d60a81a7 100644 (file)
@@ -319,7 +319,6 @@ static STACK_OF(PKCS12_SAFEBAG) *decode_contentinfo(STACK_OF(PKCS7) *safes, int
     if (enc) {
         if (!TEST_int_eq(bagnid, NID_pkcs7_encrypted))
             goto err;
-        /* TODO: Check algorithm (iterations?) against what we originally set */
         bags = PKCS12_unpack_p7encdata(p7, enc->pass, strlen(enc->pass));
     } else {
         if (!TEST_int_eq(bagnid, NID_pkcs7_data))
@@ -518,8 +517,6 @@ static int check_attrs(const STACK_OF(X509_ATTRIBUTE) *bag_attrs, const PKCS12_A
         while(p_attr->oid != NULL) {
             /* Find a matching attribute type */
             if (strcmp(p_attr->oid, attr_txt) == 0) {
-
-                /* TODO: Handle multi-value attributes */
                 if (!TEST_int_eq(X509_ATTRIBUTE_count(attr), 1))
                     goto err;
 
@@ -603,8 +600,6 @@ void check_keybag(PKCS12_BUILDER *pb, const unsigned char *bytes, int len,
             pb->success = 0;
             goto err;
         }
-        /* TODO: handle key attributes */
-        /* PKCS8_pkey_get0_attrs(p8c); */
         break;
 
     case NID_pkcs8ShroudedKeyBag:
@@ -621,8 +616,6 @@ void check_keybag(PKCS12_BUILDER *pb, const unsigned char *bytes, int len,
             pb->success = 0;
             goto err;
         }
-        /* TODO: handle key attributes */
-        /* PKCS8_pkey_get0_attrs(p8); */
         PKCS8_PRIV_KEY_INFO_free(p8);
         break;
 
index c779b723710bc2f132db0ebf0ed57bf211f6bb67..60a275a014a221e7e3245540f8b43424d9844b7f 100644 (file)
@@ -636,7 +636,7 @@ static void sv_usage(void)
 #endif
     fprintf(stderr, " -no_dhe       - disable DHE\n");
 #ifndef OPENSSL_NO_EC
-    fprintf(stderr, " -no_ecdhe     - disable ECDHE\nTODO(openssl-team): no_ecdhe was broken by auto ecdh. Make this work again.\n");
+    fprintf(stderr, " -no_ecdhe     - disable ECDHE\n");
 #endif
 #ifndef OPENSSL_NO_PSK
     fprintf(stderr, " -psk arg      - PSK in hex (without 0x)\n");
index 7275d6f9c6af19372425afde6d093bec7d6d8fc2..2b73e433052870510ec14b4799baaad189b1861b 100644 (file)
@@ -326,10 +326,6 @@ static int test_keylog_output(char *buffer, const SSL *ssl,
 
             if (!TEST_ptr(token = strtok(NULL, " \n")))
                 return 0;
-
-            /*
-             * TODO(TLS1.3): test that application traffic secrets are what
-             * we expect */
         } else {
             TEST_info("Unexpected token %s\n", token);
             return 0;
@@ -2907,10 +2903,6 @@ static int test_set_sigalgs(int idx)
                                        &sctx, &cctx, cert, privkey)))
         return 0;
 
-    /*
-     * TODO(TLS1.3): These APIs cannot set TLSv1.3 sig algs so we just test it
-     * for TLSv1.2 for now until we add a new API.
-     */
     SSL_CTX_set_max_proto_version(cctx, TLS1_2_VERSION);
 
     if (testctx) {