diff options
author | Ben Laurie <ben@openssl.org> | 2008-10-26 18:42:05 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2008-10-26 18:42:05 +0000 |
commit | 2124e869a8da94e0540d44df15bbf6007da3bf91 (patch) | |
tree | 62394b46b1fb0360d4285323abf5a48dad36ce36 | |
parent | 3b668eedda78fcf712198b3d7c433a67989da407 (diff) | |
download | openssl-2124e869a8da94e0540d44df15bbf6007da3bf91.tar.gz |
Add JPAKE.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | Makefile.org | 2 | ||||
-rw-r--r-- | apps/Makefile | 22 | ||||
-rw-r--r-- | apps/apps.c | 214 | ||||
-rw-r--r-- | apps/apps.h | 2 | ||||
-rw-r--r-- | apps/s_client.c | 11 | ||||
-rw-r--r-- | apps/s_server.c | 13 | ||||
-rw-r--r-- | crypto/crypto.h | 2 | ||||
-rw-r--r-- | crypto/des/Makefile | 10 | ||||
-rw-r--r-- | crypto/err/Makefile | 23 | ||||
-rw-r--r-- | crypto/err/err.h | 2 | ||||
-rw-r--r-- | crypto/err/err_all.c | 3 | ||||
-rw-r--r-- | crypto/err/err_str.c | 1 | ||||
-rw-r--r-- | crypto/err/openssl.ec | 1 | ||||
-rw-r--r-- | crypto/jpake/.cvsignore | 1 | ||||
-rw-r--r-- | crypto/jpake/Makefile | 49 | ||||
-rw-r--r-- | crypto/jpake/jpake.c | 468 | ||||
-rw-r--r-- | crypto/jpake/jpake.h | 115 | ||||
-rw-r--r-- | crypto/jpake/jpake_err.c | 105 | ||||
-rw-r--r-- | crypto/jpake/jpaketest.c | 176 | ||||
-rw-r--r-- | crypto/mem.c | 8 | ||||
-rw-r--r-- | fips/aes/Makefile | 9 | ||||
-rw-r--r-- | fips/des/Makefile | 12 | ||||
-rw-r--r-- | fips/dh/Makefile | 5 | ||||
-rw-r--r-- | fips/dsa/Makefile | 47 | ||||
-rw-r--r-- | fips/hmac/Makefile | 14 | ||||
-rw-r--r-- | fips/rsa/Makefile | 74 | ||||
-rw-r--r-- | fips/sha/Makefile | 14 | ||||
-rw-r--r-- | test/Makefile | 223 |
29 files changed, 1416 insertions, 214 deletions
@@ -4,6 +4,10 @@ Changes between 0.9.8i and 0.9.8j [xx XXX xxxx] + *) Add JPAKE support, including demo authentication in s_client and + s_server. + [Ben Laurie] + *) Set the comparison function in v3_addr_canonize(). [Rob Austein <sra@hactrn.net>] diff --git a/Makefile.org b/Makefile.org index f7bbb61fdd..0a2964f88f 100644 --- a/Makefile.org +++ b/Makefile.org @@ -142,7 +142,7 @@ SDIRS= \ bn ec rsa dsa ecdsa dh ecdh dso engine \ buffer bio stack lhash rand err \ evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ - store cms pqueue + store cms pqueue jpake # keep in mind that the above list is adjusted by ./Configure # according to no-xxx arguments... diff --git a/apps/Makefile b/apps/Makefile index 402981aede..a10c636552 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -193,17 +193,17 @@ apps.o: ../include/openssl/e_os2.h ../include/openssl/ec.h apps.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h apps.o: ../include/openssl/engine.h ../include/openssl/err.h apps.o: ../include/openssl/evp.h ../include/openssl/fips.h -apps.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -apps.o: ../include/openssl/objects.h ../include/openssl/ocsp.h -apps.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -apps.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -apps.o: ../include/openssl/pem2.h ../include/openssl/pkcs12.h -apps.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h -apps.o: ../include/openssl/safestack.h ../include/openssl/sha.h -apps.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -apps.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -apps.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -apps.o: ../include/openssl/x509v3.h apps.c apps.h +apps.o: ../include/openssl/jpake.h ../include/openssl/lhash.h +apps.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +apps.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h +apps.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +apps.o: ../include/openssl/pem.h ../include/openssl/pem2.h +apps.o: ../include/openssl/pkcs12.h ../include/openssl/pkcs7.h +apps.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +apps.o: ../include/openssl/sha.h ../include/openssl/stack.h +apps.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h +apps.o: ../include/openssl/ui.h ../include/openssl/x509.h +apps.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.c apps.h asn1pars.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h asn1pars.o: ../include/openssl/buffer.h ../include/openssl/conf.h asn1pars.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h diff --git a/apps/apps.c b/apps/apps.c index 5209caba2e..0547536481 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -115,6 +115,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <ctype.h> +#include <assert.h> #include <openssl/err.h> #include <openssl/x509.h> #include <openssl/x509v3.h> @@ -129,6 +130,7 @@ #include <openssl/rsa.h> #endif #include <openssl/bn.h> +#include <openssl/jpake.h> #define NON_MAIN #include "apps.h" @@ -2333,3 +2335,215 @@ void policies_print(BIO *out, X509_STORE_CTX *ctx) if (free_out) BIO_free(out); } + +static JPAKE_CTX *jpake_init(const char *us, const char *them, + const char *secret) + { + BIGNUM *p = NULL; + BIGNUM *g = NULL; + BIGNUM *q = NULL; + BIGNUM *bnsecret = BN_new(); + JPAKE_CTX *ctx; + + // Use a safe prime for p (that we found earlier) + BN_hex2bn(&p, "F9E5B365665EA7A05A9C534502780FEE6F1AB5BD4F49947FD036DBD7E905269AF46EF28B0FC07487EE4F5D20FB3C0AF8E700F3A2FA3414970CBED44FEDFF80CE78D800F184BB82435D137AADA2C6C16523247930A63B85661D1FC817A51ACD96168E95898A1F83A79FFB529368AA7833ABD1B0C3AEDDB14D2E1A2F71D99F763F"); + g = BN_new(); + BN_set_word(g, 2); + q = BN_new(); + BN_rshift1(q, p); + + BN_bin2bn(secret, strlen(secret), bnsecret); + + ctx = JPAKE_CTX_new(us, them, p, g, q, bnsecret); + BN_free(bnsecret); + BN_free(q); + BN_free(g); + BN_free(p); + + return ctx; + } + +static void jpake_send_part(BIO *conn, const JPAKE_STEP_PART *p) + { + BN_print(conn, p->gx); + BIO_puts(conn, "\n"); + BN_print(conn, p->zkpx.gr); + BIO_puts(conn, "\n"); + BN_print(conn, p->zkpx.b); + BIO_puts(conn, "\n"); + } + +static void jpake_send_step1(BIO *bconn, JPAKE_CTX *ctx) + { + JPAKE_STEP1 s1; + + JPAKE_STEP1_init(&s1); + JPAKE_STEP1_generate(&s1, ctx); + jpake_send_part(bconn, &s1.p1); + jpake_send_part(bconn, &s1.p2); + BIO_flush(bconn); + JPAKE_STEP1_release(&s1); + } + +static void jpake_send_step2(BIO *bconn, JPAKE_CTX *ctx) + { + JPAKE_STEP2 s2; + + JPAKE_STEP2_init(&s2); + JPAKE_STEP2_generate(&s2, ctx); + jpake_send_part(bconn, &s2); + BIO_flush(bconn); + JPAKE_STEP2_release(&s2); + } + +static void jpake_send_step3a(BIO *bconn, JPAKE_CTX *ctx) + { + JPAKE_STEP3A s3a; + + JPAKE_STEP3A_init(&s3a); + JPAKE_STEP3A_generate(&s3a, ctx); + BIO_write(bconn, s3a.hhk, sizeof s3a.hhk); + BIO_flush(bconn); + JPAKE_STEP3A_release(&s3a); + } + +static void jpake_send_step3b(BIO *bconn, JPAKE_CTX *ctx) + { + JPAKE_STEP3B s3b; + + JPAKE_STEP3B_init(&s3b); + JPAKE_STEP3B_generate(&s3b, ctx); + BIO_write(bconn, s3b.hk, sizeof s3b.hk); + BIO_flush(bconn); + JPAKE_STEP3B_release(&s3b); + } + +static void readbn(BIGNUM **bn, BIO *bconn) + { + char buf[10240]; + int l; + + l = BIO_gets(bconn, buf, sizeof buf); + assert(l >= 0); + assert(buf[l-1] == '\n'); + buf[l-1] = '\0'; + BN_hex2bn(bn, buf); + } + +static void jpake_receive_part(JPAKE_STEP_PART *p, BIO *bconn) + { + readbn(&p->gx, bconn); + readbn(&p->zkpx.gr, bconn); + readbn(&p->zkpx.b, bconn); + } + +static void jpake_receive_step1(JPAKE_CTX *ctx, BIO *bconn) + { + JPAKE_STEP1 s1; + + JPAKE_STEP1_init(&s1); + jpake_receive_part(&s1.p1, bconn); + jpake_receive_part(&s1.p2, bconn); + if(!JPAKE_STEP1_process(ctx, &s1)) + { + ERR_print_errors(bio_err); + exit(1); + } + JPAKE_STEP1_release(&s1); + } + +static void jpake_receive_step2(JPAKE_CTX *ctx, BIO *bconn) + { + JPAKE_STEP2 s2; + + JPAKE_STEP2_init(&s2); + jpake_receive_part(&s2, bconn); + if(!JPAKE_STEP2_process(ctx, &s2)) + { + ERR_print_errors(bio_err); + exit(1); + } + JPAKE_STEP2_release(&s2); + } + +static void jpake_receive_step3a(JPAKE_CTX *ctx, BIO *bconn) + { + JPAKE_STEP3A s3a; + int l; + + JPAKE_STEP3A_init(&s3a); + l = BIO_read(bconn, s3a.hhk, sizeof s3a.hhk); + assert(l == sizeof s3a.hhk); + if(!JPAKE_STEP3A_process(ctx, &s3a)) + { + ERR_print_errors(bio_err); + exit(1); + } + JPAKE_STEP3A_release(&s3a); + } + +static void jpake_receive_step3b(JPAKE_CTX *ctx, BIO *bconn) + { + JPAKE_STEP3B s3b; + int l; + + JPAKE_STEP3B_init(&s3b); + l = BIO_read(bconn, s3b.hk, sizeof s3b.hk); + assert(l == sizeof s3b.hk); + if(!JPAKE_STEP3B_process(ctx, &s3b)) + { + ERR_print_errors(bio_err); + exit(1); + } + JPAKE_STEP3B_release(&s3b); + } + +void jpake_client_auth(BIO *out, BIO *conn, const char *secret) + { + JPAKE_CTX *ctx; + BIO *bconn; + + BIO_puts(out, "Authenticating with JPAKE\n"); + + ctx = jpake_init("client", "server", secret); + + bconn = BIO_new(BIO_f_buffer()); + BIO_push(bconn, conn); + + jpake_send_step1(bconn, ctx); + jpake_receive_step1(ctx, bconn); + jpake_send_step2(bconn, ctx); + jpake_receive_step2(ctx, bconn); + jpake_send_step3a(bconn, ctx); + jpake_receive_step3b(ctx, bconn); + + BIO_puts(out, "JPAKE authentication succeeded\n"); + + BIO_pop(bconn); + BIO_free(bconn); + } + +void jpake_server_auth(BIO *out, BIO *conn, const char *secret) + { + JPAKE_CTX *ctx; + BIO *bconn; + + BIO_puts(out, "Authenticating with JPAKE\n"); + + ctx = jpake_init("server", "client", secret); + + bconn = BIO_new(BIO_f_buffer()); + BIO_push(bconn, conn); + + jpake_receive_step1(ctx, bconn); + jpake_send_step1(bconn, ctx); + jpake_receive_step2(ctx, bconn); + jpake_send_step2(bconn, ctx); + jpake_receive_step3a(ctx, bconn); + jpake_send_step3b(bconn, ctx); + + BIO_puts(out, "JPAKE authentication succeeded\n"); + + BIO_pop(bconn); + BIO_free(bconn); + } diff --git a/apps/apps.h b/apps/apps.h index c1ce1bc90c..b867cbead3 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -338,6 +338,8 @@ X509_NAME *parse_name(char *str, long chtype, int multirdn); int args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, X509_VERIFY_PARAM **pm); void policies_print(BIO *out, X509_STORE_CTX *ctx); +void jpake_client_auth(BIO *out, BIO *conn, const char *secret); +void jpake_server_auth(BIO *out, BIO *conn, const char *secret); #define FORMAT_UNDEF 0 #define FORMAT_ASN1 1 diff --git a/apps/s_client.c b/apps/s_client.c index 31452141c5..a00532138c 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -338,6 +338,7 @@ int MAIN(int argc, char **argv) int peerlen = sizeof(peer); int enable_timeouts = 0 ; long mtu = 0; + char *jpake_secret = NULL; #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) meth=SSLv23_client_method(); @@ -582,6 +583,11 @@ int MAIN(int argc, char **argv) /* meth=TLSv1_client_method(); */ } #endif + else if (strcmp(*argv,"-jpake") == 0) + { + if (--argc < 1) goto bad; + jpake_secret = *++argv; + } else { BIO_printf(bio_err,"unknown option %s\n",*argv); @@ -844,8 +850,6 @@ re_start: else sbio=BIO_new_socket(s,BIO_NOCLOSE); - - if (nbio_test) { BIO *test; @@ -890,6 +894,9 @@ SSL_set_tlsext_status_ids(con, ids); } #endif + if (jpake_secret) + jpake_client_auth(bio_c_out, sbio, jpake_secret); + SSL_set_bio(con,sbio,sbio); SSL_set_connect_state(con); diff --git a/apps/s_server.c b/apps/s_server.c index 7919c437c6..ead4d90e15 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -742,6 +742,8 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids)); #endif int MAIN(int, char **); +static char *jpake_secret = NULL; + int MAIN(int argc, char *argv[]) { X509_STORE *store = NULL; @@ -774,7 +776,6 @@ int MAIN(int argc, char *argv[]) EVP_PKEY *s_key2 = NULL; X509 *s_cert2 = NULL; #endif - #ifndef OPENSSL_NO_TLSEXT tlsextctx tlsextcbp = {NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING}; #endif @@ -1071,7 +1072,13 @@ int MAIN(int argc, char *argv[]) if (--argc < 1) goto bad; s_key_file2= *(++argv); } + #endif + else if (strcmp(*argv,"-jpake") == 0) + { + if (--argc < 1) goto bad; + jpake_secret = *(++argv); + } else { BIO_printf(bio_err,"unknown option %s\n",*argv); @@ -1673,6 +1680,10 @@ static int sv_body(char *hostname, int s, unsigned char *context) test=BIO_new(BIO_f_nbio_test()); sbio=BIO_push(test,sbio); } + + if(jpake_secret) + jpake_server_auth(bio_s_out, sbio, jpake_secret); + SSL_set_bio(con,sbio,sbio); SSL_set_accept_state(con); /* SSL_set_fd(con,s); */ diff --git a/crypto/crypto.h b/crypto/crypto.h index 789742918e..0e4fb0723c 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -362,6 +362,7 @@ int CRYPTO_is_mem_check_on(void); #define is_MemCheck_on() CRYPTO_is_mem_check_on() #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) +#define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__) #define OPENSSL_realloc(addr,num) \ CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) #define OPENSSL_realloc_clean(addr,old_num,num) \ @@ -473,6 +474,7 @@ void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int), void *CRYPTO_malloc_locked(int num, const char *file, int line); void CRYPTO_free_locked(void *); void *CRYPTO_malloc(int num, const char *file, int line); +char *CRYPTO_strdup(const char *str, const char *file, int line); void CRYPTO_free(void *); void *CRYPTO_realloc(void *addr,int num, const char *file, int line); void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file, diff --git a/crypto/des/Makefile b/crypto/des/Makefile index 163ba448a5..786e68802e 100644 --- a/crypto/des/Makefile +++ b/crypto/des/Makefile @@ -277,11 +277,11 @@ rpc_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h rpc_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h rpc_enc.o: des_locl.h des_ver.h rpc_des.h rpc_enc.c set_key.o: ../../include/openssl/des.h ../../include/openssl/des_old.h -set_key.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h -set_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h -set_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -set_key.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h -set_key.o: des_locl.h set_key.c +set_key.o: ../../include/openssl/e_os2.h ../../include/openssl/fips.h +set_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/ossl_typ.h +set_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h +set_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h +set_key.o: ../../include/openssl/ui_compat.h des_locl.h set_key.c str2key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h str2key.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h str2key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h diff --git a/crypto/err/Makefile b/crypto/err/Makefile index 91d1379d41..46f73b58db 100644 --- a/crypto/err/Makefile +++ b/crypto/err/Makefile @@ -89,17 +89,18 @@ err_all.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h err_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h err_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h err_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h -err_all.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h -err_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -err_all.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h -err_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -err_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h -err_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h -err_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -err_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -err_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -err_all.o: ../../include/openssl/x509v3.h err_all.c +err_all.o: ../../include/openssl/fips.h ../../include/openssl/jpake.h +err_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +err_all.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h +err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +err_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem2.h +err_all.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h +err_all.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h +err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +err_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +err_all.o: ../../include/openssl/ui.h ../../include/openssl/x509.h +err_all.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +err_all.o: err_all.c err_bio.o: ../../e_os.h ../../include/openssl/bio.h err_bio.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h err_bio.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h diff --git a/crypto/err/err.h b/crypto/err/err.h index 287d535c17..dcac415231 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -142,6 +142,7 @@ typedef struct err_state_st #define ERR_LIB_STORE 44 #define ERR_LIB_FIPS 45 #define ERR_LIB_CMS 46 +#define ERR_LIB_JPAKE 47 #define ERR_LIB_USER 128 @@ -175,6 +176,7 @@ typedef struct err_state_st #define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) #define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) #define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) +#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) /* Borland C seems too stupid to be able to shift and do longs in * the pre-processor :-( */ diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index ba87456eb6..4ca08ac2b5 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c @@ -102,6 +102,8 @@ #include <openssl/cms.h> #endif +#include <openssl/jpake.h> + void ERR_load_crypto_strings(void) { #ifndef OPENSSL_NO_ERR @@ -151,5 +153,6 @@ void ERR_load_crypto_strings(void) #ifndef OPENSSL_NO_CMS ERR_load_CMS_strings(); #endif + ERR_load_JPAKE_strings(); #endif } diff --git a/crypto/err/err_str.c b/crypto/err/err_str.c index 11aa7b7af4..d39040888d 100644 --- a/crypto/err/err_str.c +++ b/crypto/err/err_str.c @@ -148,6 +148,7 @@ static ERR_STRING_DATA ERR_str_libraries[]= {ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"}, {ERR_PACK(ERR_LIB_FIPS,0,0) ,"FIPS routines"}, {ERR_PACK(ERR_LIB_CMS,0,0) ,"CMS routines"}, +{ERR_PACK(ERR_LIB_JPAKE,0,0) ,"JPAKE routines"}, {0,NULL}, }; diff --git a/crypto/err/openssl.ec b/crypto/err/openssl.ec index b754d29686..868826624d 100644 --- a/crypto/err/openssl.ec +++ b/crypto/err/openssl.ec @@ -33,6 +33,7 @@ L ECDH crypto/ecdh/ecdh.h crypto/ecdh/ech_err.c L STORE crypto/store/store.h crypto/store/str_err.c L FIPS fips/fips.h crypto/fips_err.h L CMS crypto/cms/cms.h crypto/cms/cms_err.c +L JPAKE crypto/jpake/jpake.h crypto/jpake/jpake_err.c # additional header files to be scanned for function names L NONE crypto/x509/x509_vfy.h NONE diff --git a/crypto/jpake/.cvsignore b/crypto/jpake/.cvsignore new file mode 100644 index 0000000000..a65b41774a --- /dev/null +++ b/crypto/jpake/.cvsignore @@ -0,0 +1 @@ +lib diff --git a/crypto/jpake/Makefile b/crypto/jpake/Makefile new file mode 100644 index 0000000000..5717cf6554 --- /dev/null +++ b/crypto/jpake/Makefile @@ -0,0 +1,49 @@ +DIR=jpake +TOP=../.. + +CFLAGS= $(INCLUDES) $(CFLAG) + +LIB=$(TOP)/libcrypto.a +LIBOBJ=jpake.o jpake_err.o +LIBSRC=jpake.c jpake_err.c + +EXHEADER=jpake.h +TEST=jpaketest.c + +top: + (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) + +all: lib + +lib: $(LIBOBJ) + $(ARX) $(LIB) $(LIBOBJ) + $(RANLIB) $(LIB) || echo Never mind. + @touch lib + +links: + @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) + @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) + +depend: + @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... + $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) + +jpaketest: top jpaketest.c $(LIB) + $(CC) $(CFLAGS) -Wall -Werror -g -o jpaketest jpaketest.c $(LIB) +# DO NOT DELETE THIS LINE -- make depend depends on it. + +jpake.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +jpake.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +jpake.o: ../../include/openssl/err.h ../../include/openssl/lhash.h +jpake.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +jpake.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h +jpake.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +jpake.o: ../../include/openssl/symhacks.h jpake.c jpake.h +jpake_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +jpake_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +jpake_err.o: ../../include/openssl/err.h ../../include/openssl/jpake.h +jpake_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h +jpake_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h +jpake_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +jpake_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +jpake_err.o: jpake_err.c diff --git a/crypto/jpake/jpake.c b/crypto/jpake/jpake.c new file mode 100644 index 0000000000..3ed1d1b158 --- /dev/null +++ b/crypto/jpake/jpake.c @@ -0,0 +1,468 @@ +#include "jpake.h" + +#include <openssl/crypto.h> +#include <openssl/sha.h> +#include <openssl/err.h> +#include <memory.h> +#include <assert.h> + +/* + * In the definition, (xa, xb, xc, xd) are Alice's (x1, x2, x3, x4) or + * Bob's (x3, x4, x1, x2). If you see what I mean. + */ + +typedef struct + { + char *name; // Must be unique + char *peer_name; + BIGNUM *p; + BIGNUM *g; + BIGNUM *q; + BIGNUM *gxc; // Alice's g^{x3} or Bob's g^{x1} + BIGNUM *gxd; // Alice's g^{x4} or Bob's g^{x2} + } JPAKE_CTX_PUBLIC; + +struct JPAKE_CTX + { + JPAKE_CTX_PUBLIC p; + BIGNUM *secret; // The shared secret + BN_CTX *ctx; + BIGNUM *xa; // Alice's x1 or Bob's x3 + BIGNUM *xb; // Alice's x2 or Bob's x4 + BIGNUM *key; // The calculated (shared) key + }; + +static void JPAKE_ZKP_init(JPAKE_ZKP *zkp) + { + zkp->gr = BN_new(); + zkp->b = BN_new(); + } + +static void JPAKE_ZKP_release(JPAKE_ZKP *zkp) + { + BN_free(zkp->b); + BN_free(zkp->gr); + } + +// Two birds with one stone - make the global name as expected +#define JPAKE_STEP_PART_init JPAKE_STEP2_init +#define JPAKE_STEP_PART_release JPAKE_STEP2_release + +void JPAKE_STEP_PART_init(JPAKE_STEP_PART *p) + { + p->gx = BN_new(); + JPAKE_ZKP_init(&p->zkpx); + } + +void JPAKE_STEP_PART_release(JPAKE_STEP_PART *p) + { + JPAKE_ZKP_release(&p->zkpx); + BN_free(p->gx); + } + +void JPAKE_STEP1_init(JPAKE_STEP1 *s1) + { + JPAKE_STEP_PART_init(&s1->p1); + JPAKE_STEP_PART_init(&s1->p2); + } + +void JPAKE_STEP1_release(JPAKE_STEP1 *s1) + { + JPAKE_STEP_PART_release(&s1->p2); + JPAKE_STEP_PART_release(&s1->p1); + } + +static void JPAKE_CTX_init(JPAKE_CTX *ctx, const char *name, + const char *peer_name, const BIGNUM *p, + const BIGNUM *g, const BIGNUM *q, + const BIGNUM *secret) + { + ctx->p.name = OPENSSL_strdup(name); + ctx->p.peer_name = OPENSSL_strdup(peer_name); + ctx->p.p = BN_dup(p); + ctx->p.g = BN_dup(g); + ctx->p.q = BN_dup(q); + ctx->secret = BN_dup(secret); + + ctx->p.gxc = BN_new(); + ctx->p.gxd = BN_new(); + + ctx->xa = BN_new(); + ctx->xb = BN_new(); + ctx->key = BN_new(); + ctx->ctx = BN_CTX_new(); + } + +static void JPAKE_CTX_release(JPAKE_CTX *ctx) + { + BN_CTX_free(ctx->ctx); + BN_clear_free(ctx->key); + BN_clear_free(ctx->xb); + BN_clear_free(ctx->xa); + + BN_free(ctx->p.gxd); + BN_free(ctx->p.gxc); + + BN_clear_free(ctx->secret); + BN_free(ctx->p.q); + BN_free(ctx->p.g); + BN_free(ctx->p.p); + OPENSSL_free(ctx->p.peer_name); + OPENSSL_free(ctx->p.name); + + memset(ctx, '\0', sizeof *ctx); + } + +JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name, + const BIGNUM *p, const BIGNUM *g, const BIGNUM *q, + const BIGNUM *secret) + { + JPAKE_CTX *ctx = OPENSSL_malloc(sizeof *ctx); + + JPAKE_CTX_init(ctx, name, peer_name, p, g, q, secret); + + return ctx; + } + +void JPAKE_CTX_free(JPAKE_CTX *ctx) + { + JPAKE_CTX_release(ctx); + OPENSSL_free(ctx); + } + +static void hashlength(SHA_CTX *sha, size_t l) + { + unsigned char b[2]; + + assert(l <= 0xffff); + b[0] = l >> 8; + b[1] = l&0xff; + SHA1_Update(sha, b, 2); + } + +static void hashstring(SHA_CTX *sha, const char *string) + { + size_t l = strlen(string); + + hashlength(sha, l); + SHA1_Update(sha, string, l); + } + +static void hashbn(SHA_CTX *sha, const BIGNUM *bn) + { + size_t l = BN_num_bytes(bn); + unsigned char *bin = alloca(l); + + hashlength(sha, l); + BN_bn2bin(bn, bin); + SHA1_Update(sha, bin, l); + } + +// h=hash(g, g^r, g^x, name) +static void zkp_hash(BIGNUM *h, const BIGNUM *zkpg, const JPAKE_STEP_PART *p, + const char *proof_name) + { + unsigned char md[SHA_DIGEST_LENGTH]; + SHA_CTX sha; + + // XXX: hash should not allow moving of the boundaries - Java code + // is flawed in this respect. Length encoding seems simplest. + SHA1_Init(&sha); + hashbn(&sha, zkpg); + assert(!BN_is_zero(p->zkpx.gr)); + hashbn(&sha, p->zkpx.gr); + hashbn(&sha, p->gx); + hashstring(&sha, proof_name); + SHA1_Final(md, &sha); + BN_bin2bn(md, SHA_DIGEST_LENGTH, h); + } + +// Prove knowledge of x +// Note that p->gx has already been calculated +static void generate_zkp(JPAKE_STEP_PART *p, const BIGNUM *x, + const BIGNUM *zkpg, JPAKE_CTX *ctx) + { + BIGNUM *r = BN_new(); + BIGNUM *h = BN_new(); + BIGNUM *t = BN_new(); + + // r in [0,q) + // XXX: Java chooses r in [0, 2^160) - i.e. distribution not uniform + BN_rand_range(r, ctx->p.q); + // g^r + BN_mod_exp(p->zkpx.gr, zkpg, r, ctx->p.p, ctx->ctx); + + // h=hash... + zkp_hash(h, zkpg, p, ctx->p.name); + + // b = r - x*h + BN_mod_mul(t, x, h, ctx->p.q, ctx->ctx); + BN_mod_sub(p->zkpx.b, r, t, ctx->p.q, ctx->ctx); + + // cleanup + BN_free(t); + BN_free(h); + BN_free(r); + } + +static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg, + JPAKE_CTX *ctx) + { + BIGNUM *h = BN_new(); + BIGNUM *t1 = BN_new(); + BIGNUM *t2 = BN_new(); + BIGNUM *t3 = BN_new(); + int ret = 0; + + zkp_hash(h, zkpg, p, ctx->p.peer_name); + + // t1 = g^b + BN_mod_exp(t1, zkpg, p->zkpx.b, ctx->p.p, ctx->ctx); + // t2 = (g^x)^h = g^{hx} + BN_mod_exp(t2, p->gx, h, ctx->p.p, ctx->ctx); + // t3 = t1 * t2 = g^{hx} * g^b = g^{hx+b} = g^r (allegedly) + BN_mod_mul(t3, t1, t2, ctx->p.p, ctx->ctx); + + // verify t3 == g^r + if(BN_cmp(t3, p->zkpx.gr) == 0) + ret = 1; + else + JPAKEerr(JPAKE_F_VERIFY_ZKP, JPAKE_R_ZKP_VERIFY_FAILED); + + // cleanup + BN_free(t3); + BN_free(t2); + BN_free(t1); + BN_free(h); + + return ret; + } + +static void generate_step_part(JPAKE_STEP_PART *p, const BIGNUM *x, + const BIGNUM *g, JPAKE_CTX *ctx) + { + BN_mod_exp(p->gx, g, x, ctx->p.p, ctx->ctx); + generate_zkp(p, x, g, ctx); + } + +// Generate each party's random numbers. xa is in [0, q), xb is in [1, q). +static void genrand(JPAKE_CTX *ctx) + { + BIGNUM *qm1; + + // xa in [0, q) + BN_rand_range(ctx->xa, ctx->p.q); + + // q-1 + qm1 = BN_new(); + BN_copy(qm1, ctx->p.q); + BN_sub_word(qm1, 1); + + // ... and xb in [0, q-1) + BN_rand_range(ctx->xb, qm1); + // [1, q) + BN_add_word(ctx->xb, 1); + + // cleanup + BN_free(qm1); + } + +int JPAKE_STEP1_generate(JPAKE_STEP1 *send, JPAKE_CTX *ctx) + { + genrand(ctx); + generate_step_part(&send->p1, ctx->xa, ctx->p.g, ctx); + generate_step_part(&send->p2, ctx->xb, ctx->p.g, ctx); + + return 1; + } + +int JPAKE_STEP1_process(JPAKE_CTX *ctx, const JPAKE_STEP1 *received) + { + // verify their ZKP(xc) + if(!verify_zkp(&received->p1, ctx->p.g, ctx)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X3_FAILED); + return 0; + } + + // verify their ZKP(xd) + if(!verify_zkp(&received->p2, ctx->p.g, ctx)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X4_FAILED); + return 0; + } + + // g^xd != 1 + if(BN_is_one(received->p2.gx)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X4_IS_ONE); + return 0; + } + + // Save the bits we need for later + BN_copy(ctx->p.gxc, received->p1.gx); + BN_copy(ctx->p.gxd, received->p2.gx); + + return 1; + } + + +int JPAKE_STEP2_generate(JPAKE_STEP2 *send, JPAKE_CTX *ctx) + { + BIGNUM *t1 = BN_new(); + BIGNUM *t2 = BN_new(); + + // X = g^{(xa + xc + xd) * xb * s} + // t1 = g^xa + BN_mod_exp(t1, ctx->p.g, ctx->xa, ctx->p.p, ctx->ctx); + // t2 = t1 * g^{xc} = g^{xa} * g^{xc} = g^{xa + xc} + BN_mod_mul(t2, t1, ctx->p.gxc, ctx->p.p, ctx->ctx); + // t1 = t2 * g^{xd} = g^{xa + xc + xd} + BN_mod_mul(t1, t2, ctx->p.gxd, ctx->p.p, ctx->ctx); + // t2 = xb * s + BN_mod_mul(t2, ctx->xb, ctx->secret, ctx->p.q, ctx->ctx); + + // ZKP(xb * s) + // XXX: this is kinda funky, because we're using + // + // g' = g^{xa + xc + xd} + // + // as the generator, which means X is g'^{xb * s} + // X = t1^{t2} = t1^{xb * s} = g^{(xa + xc + xd) * xb * s} + generate_step_part(send, t2, t1, ctx); + + // cleanup + BN_free(t1); + BN_free(t2); + + return 1; + } + +// gx = g^{xc + xa + xb} * xd * s +static int compute_key(JPAKE_CTX *ctx, const BIGNUM *gx) + { + BIGNUM *t1 = BN_new(); + BIGNUM *t2 = BN_new(); + BIGNUM *t3 = BN_new(); + + // K = (gx/g^{xb * xd * s})^{xb} + // = (g^{(xc + xa + xb) * xd * s - xb * xd *s})^{xb} + // = (g^{(xa + xc) * xd * s})^{xb} + // = g^{(xa + xc) * xb * xd * s} + // [which is the same regardless of who calculates it] + + // t1 = (g^{xd})^{xb} = g^{xb * xd} + BN_mod_exp(t1, ctx->p.gxd, ctx->xb, ctx->p.p, ctx->ctx); + // t2 = -s = q-s + BN_sub(t2, ctx->p.q, ctx->secret); + // t3 = t1^t2 = g^{-xb * xd * s} + BN_mod_exp(t3, t1, t2, ctx->p.p, ctx->ctx); + // t1 = gx * t3 = X/g^{xb * xd * s} + BN_mod_mul(t1, gx, t3, ctx->p.p, ctx->ctx); + // K = t1^{xb} + BN_mod_exp(ctx->key, t1, ctx->xb, ctx->p.p, ctx->ctx); + + // cleanup + BN_free(t3); + BN_free(t2); + BN_free(t1); + + return 1; + } + +int JPAKE_STEP2_process(JPAKE_CTX *ctx, const JPAKE_STEP2 *received) + { + BIGNUM *t1 = BN_new(); + BIGNUM *t2 = BN_new(); + int ret = 0; + + // g' = g^{xc + xa + xb} [from our POV] + // t1 = xa + xb + BN_mod_add(t1, ctx->xa, ctx->xb, ctx->p.q, ctx->ctx); + // t2 = g^{t1} = g^{xa+xb} + BN_mod_exp(t2, ctx->p.g, t1, ctx->p.p, ctx->ctx); + // t1 = g^{xc} * t2 = g^{xc + xa + xb} + BN_mod_mul(t1, ctx->p.gxc, t2, ctx->p.p, ctx->ctx); + + if(verify_zkp(received, t1, ctx)) + ret = 1; + else + JPAKEerr(JPAKE_F_JPAKE_STEP2_PROCESS, JPAKE_R_VERIFY_B_FAILED); + + compute_key(ctx, received->gx); + + // cleanup + BN_free(t2); + BN_free(t1); + + return ret; + } + +static void quickhashbn(unsigned char *md, const BIGNUM *bn) + { + SHA_CTX sha; + + SHA1_Init(&sha); + hashbn(&sha, bn); + SHA1_Final(md, &sha); + } + +void JPAKE_STEP3A_init(JPAKE_STEP3A *s3a) + {} + +int JPAKE_STEP3A_generate(JPAKE_STEP3A *send, JPAKE_CTX *ctx) + { + quickhashbn(send->hhk, ctx->key); + SHA1(send->hhk, sizeof send->hhk, send->hhk); + + return 1; + } + +int JPAKE_STEP3A_process(JPAKE_CTX *ctx, const JPAKE_STEP3A *received) + { + unsigned char hhk[SHA_DIGEST_LENGTH]; + + quickhashbn(hhk, ctx->key); + SHA1(hhk, sizeof hhk, hhk); + if(memcmp(hhk, received->hhk, sizeof hhk)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP3A_PROCESS, JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH); + return 0; + } + return 1; + } + +void JPAKE_STEP3A_release(JPAKE_STEP3A *s3a) + {} + +void JPAKE_STEP3B_init(JPAKE_STEP3B *s3b) + {} + +int JPAKE_STEP3B_generate(JPAKE_STEP3B *send, JPAKE_CTX *ctx) + { + quickhashbn(send->hk, ctx->key); + + return 1; + } + +int JPAKE_STEP3B_process(JPAKE_CTX *ctx, const JPAKE_STEP3B *received) + { + unsigned char hk[SHA_DIGEST_LENGTH]; + + quickhashbn(hk, ctx->key); + if(memcmp(hk, received->hk, sizeof hk)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP3B_PROCESS, JPAKE_R_HASH_OF_KEY_MISMATCH); + return 0; + } + return 1; + } + +void JPAKE_STEP3B_release(JPAKE_STEP3B *s3b) + {} + +const BIGNUM *JPAKE_get_shared_key(JPAKE_CTX *ctx) + { + return ctx->key; + } + diff --git a/crypto/jpake/jpake.h b/crypto/jpake/jpake.h new file mode 100644 index 0000000000..4c67a24378 --- /dev/null +++ b/crypto/jpake/jpake.h @@ -0,0 +1,115 @@ +/* + * Implement J-PAKE, as described in + * http://grouper.ieee.org/groups/1363/Research/contributions/hao-ryan-2008.pdf + * + * With hints from http://www.cl.cam.ac.uk/~fh240/software/JPAKE2.java. + */ + +#ifndef HEADER_JPAKE_H +#define HEADER_JPAKE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <openssl/bn.h> +#include <openssl/sha.h> + +typedef struct JPAKE_CTX JPAKE_CTX; + +// Note that "g" in the ZKPs is not necessarily the J-PAKE g. +typedef struct + { + BIGNUM *gr; // g^r (r random) + BIGNUM *b; // b = r - x*h, h=hash(g, g^r, g^x, name) + } JPAKE_ZKP; + +typedef struct + { + BIGNUM *gx; // g^x in step 1, g^(xa + xc + xd) * xb * s in step 2 + JPAKE_ZKP zkpx; // ZKP(x) or ZKP(xb * s) + } JPAKE_STEP_PART; + +typedef struct + { + JPAKE_STEP_PART p1; // g^x3, ZKP(x3) or g^x1, ZKP(x1) + JPAKE_STEP_PART p2; // g^x4, ZKP(x4) or g^x2, ZKP(x2) + } JPAKE_STEP1; + +typedef JPAKE_STEP_PART JPAKE_STEP2; + +typedef struct + { + unsigned char hhk[SHA_DIGEST_LENGTH]; + } JPAKE_STEP3A; + +typedef struct + { + unsigned char hk[SHA_DIGEST_LENGTH]; + } JPAKE_STEP3B; + +// Parameters are copied +JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name, + const BIGNUM *p, const BIGNUM *g, const BIGNUM *q, + const BIGNUM *secret); +void JPAKE_CTX_free(JPAKE_CTX *ctx); + +// Note that JPAKE_STEP1 can be used multiple times before release +// without another init. +void JPAKE_STEP1_init(JPAKE_STEP1 *s1); +int JPAKE_STEP1_generate(JPAKE_STEP1 *send, JPAKE_CTX *ctx); +int JPAKE_STEP1_process(JPAKE_CTX *ctx, const JPAKE_STEP1 *received); +void JPAKE_STEP1_release(JPAKE_STEP1 *s1); + +// Note that JPAKE_STEP2 can be used multiple times before release +// without another init. +void JPAKE_STEP2_init(JPAKE_STEP2 *s2); +int JPAKE_STEP2_generate(JPAKE_STEP2 *send, JPAKE_CTX *ctx); +int JPAKE_STEP2_process(JPAKE_CTX *ctx, const JPAKE_STEP2 *received); +void JPAKE_STEP2_release(JPAKE_STEP2 *s2); + +// Optionally verify the shared key. If the shared secrets do not +// match, the two ends will disagree about the shared key, but +// otherwise the protocol will succeed. +void JPAKE_STEP3A_init(JPAKE_STEP3A *s3a); +int JPAKE_STEP3A_generate(JPAKE_STEP3A *send, JPAKE_CTX *ctx); +int JPAKE_STEP3A_process(JPAKE_CTX *ctx, const JPAKE_STEP3A *received); +void JPAKE_STEP3A_release(JPAKE_STEP3A *s3a); + +void JPAKE_STEP3B_init(JPAKE_STEP3B *s3b); +int JPAKE_STEP3B_generate(JPAKE_STEP3B *send, JPAKE_CTX *ctx); +int JPAKE_STEP3B_process(JPAKE_CTX *ctx, const JPAKE_STEP3B *received); +void JPAKE_STEP3B_release(JPAKE_STEP3B *s3b); + +// the return value belongs to the library and will be released when +// ctx is released, and will change when a new handshake is performed. +const BIGNUM *JPAKE_get_shared_key(JPAKE_CTX *ctx); + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_JPAKE_strings(void); + +/* Error codes for the JPAKE functions. */ + +/* Function codes. */ +#define JPAKE_F_JPAKE_STEP1_PROCESS 101 +#define JPAKE_F_JPAKE_STEP2_PROCESS 102 +#define JPAKE_F_JPAKE_STEP3A_PROCESS 103 +#define JPAKE_F_JPAKE_STEP3B_PROCESS 104 +#define JPAKE_F_VERIFY_ZKP 100 + +/* Reason codes. */ +#define JPAKE_R_G_TO_THE_X4_IS_ONE 105 +#define JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH 106 +#define JPAKE_R_HASH_OF_KEY_MISMATCH 107 +#define JPAKE_R_VERIFY_B_FAILED 102 +#define JPAKE_R_VERIFY_X3_FAILED 103 +#define JPAKE_R_VERIFY_X4_FAILED 104 +#define JPAKE_R_ZKP_VERIFY_FAILED 100 + +#ifdef __cplusplus +} +#endif +#endif diff --git a/crypto/jpake/jpake_err.c b/crypto/jpake/jpake_err.c new file mode 100644 index 0000000000..1b95067967 --- /dev/null +++ b/crypto/jpake/jpake_err.c @@ -0,0 +1,105 @@ +/* crypto/jpake/jpake_err.c */ +/* ==================================================================== + * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +/* NOTE: this file was auto generated by the mkerr.pl script: any changes + * made to it will be overwritten when the script next updates this file, + * only reason strings will be preserved. + */ + +#include <stdio.h> +#include <openssl/err.h> +#include <openssl/jpake.h> + +/* BEGIN ERROR CODES */ +#ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(ERR_LIB_JPAKE,func,0) +#define ERR_REASON(reason) ERR_PACK(ERR_LIB_JPAKE,0,reason) + +static ERR_STRING_DATA JPAKE_str_functs[]= + { +{ERR_FUNC(JPAKE_F_JPAKE_STEP1_PROCESS), "JPAKE_STEP1_process"}, +{ERR_FUNC(JPAKE_F_JPAKE_STEP2_PROCESS), "JPAKE_STEP2_process"}, +{ERR_FUNC(JPAKE_F_JPAKE_STEP3A_PROCESS), "JPAKE_STEP3A_process"}, +{ERR_FUNC(JPAKE_F_JPAKE_STEP3B_PROCESS), "JPAKE_STEP3B_process"}, +{ERR_FUNC(JPAKE_F_VERIFY_ZKP), "VERIFY_ZKP"}, +{0,NULL} + }; + +static ERR_STRING_DATA JPAKE_str_reasons[]= + { +{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_ONE) ,"g to the x4 is one"}, +{ERR_REASON(JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH),"hash of hash of key mismatch"}, +{ERR_REASON(JPAKE_R_HASH_OF_KEY_MISMATCH),"hash of key mismatch"}, +{ERR_REASON(JPAKE_R_VERIFY_B_FAILED) ,"verify b failed"}, +{ERR_REASON(JPAKE_R_VERIFY_X3_FAILED) ,"verify x3 failed"}, +{ERR_REASON(JPAKE_R_VERIFY_X4_FAILED) ,"verify x4 failed"}, +{ERR_REASON(JPAKE_R_ZKP_VERIFY_FAILED) ,"zkp verify failed"}, +{0,NULL} + }; + +#endif + +void ERR_load_JPAKE_strings(void) + { +#ifndef OPENSSL_NO_ERR + + if (ERR_func_error_string(JPAKE_str_functs[0].error) == NULL) + { + ERR_load_strings(0,JPAKE_str_functs); + ERR_load_strings(0,JPAKE_str_reasons); + } +#endif + } diff --git a/crypto/jpake/jpaketest.c b/crypto/jpake/jpaketest.c new file mode 100644 index 0000000000..13b2e1f119 --- /dev/null +++ b/crypto/jpake/jpaketest.c @@ -0,0 +1,176 @@ +#include <openssl/jpake.h> +#include <openssl/err.h> + +static void showbn(const char *name, const BIGNUM *bn) + { + fputs(name, stdout); + fputs(" = ", stdout); + BN_print_fp(stdout, bn); + putc('\n', stdout); + } + +static int run_jpake(JPAKE_CTX *alice, JPAKE_CTX *bob) + { + JPAKE_STEP1 alice_s1; + JPAKE_STEP1 bob_s1; + JPAKE_STEP2 alice_s2; + JPAKE_STEP2 bob_s2; + JPAKE_STEP3A alice_s3a; + JPAKE_STEP3B bob_s3b; + + // Alice -> Bob: step 1 + puts("A->B s1"); + JPAKE_STEP1_init(&alice_s1); + JPAKE_STEP1_generate(&alice_s1, alice); + if(!JPAKE_STEP1_process(bob, &alice_s1)) + { + printf("Bob fails to process Alice's step 1\n"); + ERR_print_errors_fp(stdout); + return 1; + } + JPAKE_STEP1_release(&alice_s1); + + // Bob -> Alice: step 1 + puts("B->A s1"); + JPAKE_STEP1_init(&bob_s1); + JPAKE_STEP1_generate(&bob_s1, bob); + if(!JPAKE_STEP1_process(alice, &bob_s1)) + { + printf("Alice fails to process Bob's step 1\n"); + ERR_print_errors_fp(stdout); + return 2; + } + JPAKE_STEP1_release(&bob_s1); + + // Alice -> Bob: step 2 + puts("A->B s2"); + JPAKE_STEP2_init(&alice_s2); + JPAKE_STEP2_generate(&alice_s2, alice); + if(!JPAKE_STEP2_process(bob, &alice_s2)) + { + printf("Bob fails to process Alice's step 2\n"); + ERR_print_errors_fp(stdout); + return 3; + } + JPAKE_STEP2_release(&alice_s2); + + // Bob -> Alice: step 2 + puts("B->A s2"); + JPAKE_STEP2_init(&bob_s2); + JPAKE_STEP2_generate(&bob_s2, bob); + if(!JPAKE_STEP2_process(alice, &bob_s2)) + { + printf("Alice fails to process Bob's step 2\n"); + ERR_print_errors_fp(stdout); + return 4; + } + JPAKE_STEP2_release(&bob_s2); + + showbn("Alice's key", JPAKE_get_shared_key(alice)); + showbn("Bob's key ", JPAKE_get_shared_key(bob)); + + // Alice -> Bob: step 3a + puts("A->B s3a"); + JPAKE_STEP3A_init(&alice_s3a); + JPAKE_STEP3A_generate(&alice_s3a, alice); + if(!JPAKE_STEP3A_process(bob, &alice_s3a)) + { + printf("Bob fails to process Alice's step 3a\n"); + ERR_print_errors_fp(stdout); + return 5; + } + JPAKE_STEP3A_release(&alice_s3a); + + // Bob -> Alice: step 3b + puts("B->A s3b"); + JPAKE_STEP3B_init(&bob_s3b); + JPAKE_STEP3B_generate(&bob_s3b, bob); + if(!JPAKE_STEP3B_process(alice, &bob_s3b)) + { + printf("Alice fails to process Bob's step 3b\n"); + ERR_print_errors_fp(stdout); + return 6; + } + JPAKE_STEP3B_release(&bob_s3b); + + return 0; + } + +int main(int argc, char **argv) + { + JPAKE_CTX *alice; + JPAKE_CTX *bob; + BIGNUM *p = NULL; + BIGNUM *g = NULL; + BIGNUM *q = NULL; + BIGNUM *secret = BN_new(); + BIO *bio_err; + + bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); + + CRYPTO_malloc_debug_init(); + CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + ERR_load_crypto_strings(); + + /* + BN_hex2bn(&p, "fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7"); + BN_hex2bn(&g, "f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a"); + BN_hex2bn(&q, "9760508f15230bccb292b982a2eb840bf0581cf5"); + */ + /* + p = BN_new(); + BN_generate_prime(p, 1024, 1, NULL, NULL, NULL, NULL); + */ + // Use a safe prime for p (that we found earlier) + BN_hex2bn(&p, "F9E5B365665EA7A05A9C534502780FEE6F1AB5BD4F49947FD036DBD7E905269AF46EF28B0FC07487EE4F5D20FB3C0AF8E700F3A2FA3414970CBED44FEDFF80CE78D800F184BB82435D137AADA2C6C16523247930A63B85661D1FC817A51ACD96168E95898A1F83A79FFB529368AA7833ABD1B0C3AEDDB14D2E1A2F71D99F763F"); + showbn("p", p); + g = BN_new(); + BN_set_word(g, 2); + showbn("g", g); + q = BN_new(); + BN_rshift1(q, p); + showbn("q", q); + + BN_rand(secret, 32, -1, 0); + + // A normal run, expect this to work... + alice = JPAKE_CTX_new("Alice", "Bob", p, g, q, secret); + bob = JPAKE_CTX_new("Bob", "Alice", p, g, q, secret); + + if(run_jpake(alice, bob) != 0) + { + fprintf(stderr, "Plain JPAKE run failed\n"); + return 1; + } + + JPAKE_CTX_free(bob); + JPAKE_CTX_free(alice); + + // Now give Alice and Bob different secrets + alice = JPAKE_CTX_new("Alice", "Bob", p, g, q, secret); + BN_add_word(secret, 1); + bob = JPAKE_CTX_new("Bob", "Alice", p, g, q, secret); + + if(run_jpake(alice, bob) != 5) + { + fprintf(stderr, "Mismatched secret JPAKE run failed\n"); + return 1; + } + + JPAKE_CTX_free(bob); + JPAKE_CTX_free(alice); + + BN_free(secret); + BN_free(q); + BN_free(g); + BN_free(p); + + CRYPTO_cleanup_all_ex_data(); + ERR_remove_state(0); + ERR_free_strings(); + CRYPTO_mem_leaks(bio_err); + + return 0; + } diff --git a/crypto/mem.c b/crypto/mem.c index 00ebaf0b9b..3d839b9610 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -341,6 +341,14 @@ void *CRYPTO_malloc(int num, const char *file, int line) return ret; } +char *CRYPTO_strdup(const char *str, const char *file, int line) + { + char *ret = CRYPTO_malloc(strlen(str)+1, file, line); + + strcpy(ret, str); + return ret; + } + void *CRYPTO_realloc(void *str, int num, const char *file, int line) { void *ret = NULL; diff --git a/fips/aes/Makefile b/fips/aes/Makefile index dff1b97efa..403525d4c0 100644 --- a/fips/aes/Makefile +++ b/fips/aes/Makefile @@ -101,10 +101,11 @@ fips_aes_selftest.o: ../../include/openssl/stack.h fips_aes_selftest.o: ../../include/openssl/symhacks.h fips_aes_selftest.c fips_aesavs.o: ../../e_os.h ../../include/openssl/aes.h fips_aesavs.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_aesavs.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_aesavs.o: ../../include/openssl/err.h ../../include/openssl/evp.h -fips_aesavs.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h -fips_aesavs.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +fips_aesavs.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h +fips_aesavs.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +fips_aesavs.o: ../../include/openssl/evp.h ../../include/openssl/fips.h +fips_aesavs.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +fips_aesavs.o: ../../include/openssl/objects.h fips_aesavs.o: ../../include/openssl/opensslconf.h fips_aesavs.o: ../../include/openssl/opensslv.h fips_aesavs.o: ../../include/openssl/ossl_typ.h diff --git a/fips/des/Makefile b/fips/des/Makefile index 9b34c0af2d..ba1d0952b9 100644 --- a/fips/des/Makefile +++ b/fips/des/Makefile @@ -97,12 +97,12 @@ fips_des_selftest.o: ../../include/openssl/safestack.h fips_des_selftest.o: ../../include/openssl/stack.h fips_des_selftest.o: ../../include/openssl/symhacks.h fips_des_selftest.c fips_desmovs.o: ../../e_os.h ../../include/openssl/asn1.h -fips_desmovs.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h -fips_desmovs.o: ../../include/openssl/des.h ../../include/openssl/des_old.h -fips_desmovs.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -fips_desmovs.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_desmovs.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h -fips_desmovs.o: ../../include/openssl/objects.h +fips_desmovs.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +fips_desmovs.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +fips_desmovs.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h +fips_desmovs.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_desmovs.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h +fips_desmovs.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h fips_desmovs.o: ../../include/openssl/opensslconf.h fips_desmovs.o: ../../include/openssl/opensslv.h fips_desmovs.o: ../../include/openssl/ossl_typ.h diff --git a/fips/dh/Makefile b/fips/dh/Makefile index a4e2e7738a..2d3833a822 100644 --- a/fips/dh/Makefile +++ b/fips/dh/Makefile @@ -105,8 +105,9 @@ fips_dh_key.o: ../../include/openssl/opensslv.h fips_dh_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h fips_dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h fips_dh_key.o: ../../include/openssl/symhacks.h fips_dh_key.c -fips_dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h -fips_dh_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +fips_dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +fips_dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h +fips_dh_lib.o: ../../include/openssl/e_os2.h fips_dh_lib.o: ../../include/openssl/opensslconf.h fips_dh_lib.o: ../../include/openssl/opensslv.h fips_dh_lib.o: ../../include/openssl/ossl_typ.h diff --git a/fips/dsa/Makefile b/fips/dsa/Makefile index 0a9f8c29d0..251615e9ad 100644 --- a/fips/dsa/Makefile +++ b/fips/dsa/Makefile @@ -110,8 +110,9 @@ fips_dsa_key.o: ../../include/openssl/opensslv.h fips_dsa_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h fips_dsa_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h fips_dsa_key.o: ../../include/openssl/symhacks.h ../fips_locl.h fips_dsa_key.c -fips_dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h -fips_dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +fips_dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +fips_dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h +fips_dsa_lib.o: ../../include/openssl/e_os2.h fips_dsa_lib.o: ../../include/openssl/opensslconf.h fips_dsa_lib.o: ../../include/openssl/opensslv.h fips_dsa_lib.o: ../../include/openssl/ossl_typ.h @@ -122,9 +123,9 @@ fips_dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h fips_dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h fips_dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h fips_dsa_ossl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -fips_dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/evp.h -fips_dsa_ossl.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h -fips_dsa_ossl.o: ../../include/openssl/obj_mac.h +fips_dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h +fips_dsa_ossl.o: ../../include/openssl/evp.h ../../include/openssl/fips.h +fips_dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h fips_dsa_ossl.o: ../../include/openssl/objects.h fips_dsa_ossl.o: ../../include/openssl/opensslconf.h fips_dsa_ossl.o: ../../include/openssl/opensslv.h @@ -134,10 +135,10 @@ fips_dsa_ossl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h fips_dsa_ossl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h fips_dsa_ossl.o: ../../include/openssl/x509_vfy.h fips_dsa_ossl.c fips_dsa_selftest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_dsa_selftest.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h -fips_dsa_selftest.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -fips_dsa_selftest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_dsa_selftest.o: ../../include/openssl/lhash.h +fips_dsa_selftest.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h +fips_dsa_selftest.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +fips_dsa_selftest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_dsa_selftest.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h fips_dsa_selftest.o: ../../include/openssl/obj_mac.h fips_dsa_selftest.o: ../../include/openssl/objects.h fips_dsa_selftest.o: ../../include/openssl/opensslconf.h @@ -147,10 +148,11 @@ fips_dsa_selftest.o: ../../include/openssl/safestack.h fips_dsa_selftest.o: ../../include/openssl/stack.h fips_dsa_selftest.o: ../../include/openssl/symhacks.h fips_dsa_selftest.c fips_dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h -fips_dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -fips_dsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +fips_dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h +fips_dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +fips_dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_dsa_sign.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h +fips_dsa_sign.o: ../../include/openssl/obj_mac.h fips_dsa_sign.o: ../../include/openssl/objects.h fips_dsa_sign.o: ../../include/openssl/opensslconf.h fips_dsa_sign.o: ../../include/openssl/opensslv.h @@ -159,15 +161,16 @@ fips_dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h fips_dsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h fips_dsa_sign.o: fips_dsa_sign.c fips_dsatest.o: ../../e_os.h ../../include/openssl/asn1.h -fips_dsatest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h -fips_dsatest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -fips_dsatest.o: ../../include/openssl/des_old.h ../../include/openssl/dsa.h -fips_dsatest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -fips_dsatest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -fips_dsatest.o: ../../include/openssl/engine.h ../../include/openssl/err.h -fips_dsatest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_dsatest.o: ../../include/openssl/fips_rand.h ../../include/openssl/lhash.h -fips_dsatest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +fips_dsatest.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +fips_dsatest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +fips_dsatest.o: ../../include/openssl/des.h ../../include/openssl/des_old.h +fips_dsatest.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +fips_dsatest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h +fips_dsatest.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h +fips_dsatest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_dsatest.o: ../../include/openssl/fips.h ../../include/openssl/fips_rand.h +fips_dsatest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +fips_dsatest.o: ../../include/openssl/objects.h fips_dsatest.o: ../../include/openssl/opensslconf.h fips_dsatest.o: ../../include/openssl/opensslv.h fips_dsatest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h diff --git a/fips/hmac/Makefile b/fips/hmac/Makefile index bc8d825e0c..be230ade9d 100644 --- a/fips/hmac/Makefile +++ b/fips/hmac/Makefile @@ -106,13 +106,13 @@ fips_hmac_selftest.o: ../../include/openssl/safestack.h fips_hmac_selftest.o: ../../include/openssl/stack.h fips_hmac_selftest.o: ../../include/openssl/symhacks.h fips_hmac_selftest.c fips_hmactest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_hmactest.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -fips_hmactest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_hmactest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -fips_hmactest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -fips_hmactest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_hmactest.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h -fips_hmactest.o: ../../include/openssl/obj_mac.h +fips_hmactest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +fips_hmactest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +fips_hmactest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +fips_hmactest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h +fips_hmactest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_hmactest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h +fips_hmactest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h fips_hmactest.o: ../../include/openssl/objects.h fips_hmactest.o: ../../include/openssl/opensslconf.h fips_hmactest.o: ../../include/openssl/opensslv.h diff --git a/fips/rsa/Makefile b/fips/rsa/Makefile index aadb2f9064..da28c13aa6 100644 --- a/fips/rsa/Makefile +++ b/fips/rsa/Makefile @@ -116,17 +116,18 @@ fips_rsa_gen.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h fips_rsa_gen.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h fips_rsa_gen.o: ../../include/openssl/symhacks.h ../fips_locl.h fips_rsa_gen.c fips_rsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_rsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h -fips_rsa_lib.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h -fips_rsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +fips_rsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h +fips_rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +fips_rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/fips.h +fips_rsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +fips_rsa_lib.o: ../../include/openssl/objects.h fips_rsa_lib.o: ../../include/openssl/opensslconf.h fips_rsa_lib.o: ../../include/openssl/opensslv.h fips_rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h fips_rsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h fips_rsa_lib.o: ../../include/openssl/symhacks.h fips_rsa_lib.c fips_rsa_selftest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_rsa_selftest.o: ../../include/openssl/crypto.h +fips_rsa_selftest.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h fips_rsa_selftest.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h fips_rsa_selftest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h fips_rsa_selftest.o: ../../include/openssl/lhash.h @@ -162,50 +163,53 @@ fips_rsa_x931g.o: ../../include/openssl/safestack.h fips_rsa_x931g.o: ../../include/openssl/stack.h fips_rsa_x931g.o: ../../include/openssl/symhacks.h fips_rsa_x931g.c fips_rsagtest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_rsagtest.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -fips_rsagtest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_rsagtest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -fips_rsagtest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -fips_rsagtest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_rsagtest.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h -fips_rsagtest.o: ../../include/openssl/obj_mac.h +fips_rsagtest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +fips_rsagtest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +fips_rsagtest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +fips_rsagtest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h +fips_rsagtest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_rsagtest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h +fips_rsagtest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h fips_rsagtest.o: ../../include/openssl/objects.h fips_rsagtest.o: ../../include/openssl/opensslconf.h fips_rsagtest.o: ../../include/openssl/opensslv.h fips_rsagtest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h -fips_rsagtest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -fips_rsagtest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -fips_rsagtest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +fips_rsagtest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +fips_rsagtest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +fips_rsagtest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +fips_rsagtest.o: ../../include/openssl/x509_vfy.h fips_rsagtest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsagtest.c fips_rsastest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_rsastest.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -fips_rsastest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_rsastest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -fips_rsastest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -fips_rsastest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_rsastest.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h -fips_rsastest.o: ../../include/openssl/obj_mac.h +fips_rsastest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +fips_rsastest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +fips_rsastest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +fips_rsastest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h +fips_rsastest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_rsastest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h +fips_rsastest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h fips_rsastest.o: ../../include/openssl/objects.h fips_rsastest.o: ../../include/openssl/opensslconf.h fips_rsastest.o: ../../include/openssl/opensslv.h fips_rsastest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h -fips_rsastest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -fips_rsastest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -fips_rsastest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +fips_rsastest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +fips_rsastest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +fips_rsastest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +fips_rsastest.o: ../../include/openssl/x509_vfy.h fips_rsastest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsastest.c fips_rsavtest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_rsavtest.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -fips_rsavtest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_rsavtest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -fips_rsavtest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -fips_rsavtest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_rsavtest.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h -fips_rsavtest.o: ../../include/openssl/obj_mac.h +fips_rsavtest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +fips_rsavtest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +fips_rsavtest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +fips_rsavtest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h +fips_rsavtest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_rsavtest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h +fips_rsavtest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h fips_rsavtest.o: ../../include/openssl/objects.h fips_rsavtest.o: ../../include/openssl/opensslconf.h fips_rsavtest.o: ../../include/openssl/opensslv.h fips_rsavtest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h -fips_rsavtest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -fips_rsavtest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -fips_rsavtest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +fips_rsavtest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +fips_rsavtest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +fips_rsavtest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +fips_rsavtest.o: ../../include/openssl/x509_vfy.h fips_rsavtest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsavtest.c diff --git a/fips/sha/Makefile b/fips/sha/Makefile index 00b4cfa49d..a661640bc6 100644 --- a/fips/sha/Makefile +++ b/fips/sha/Makefile @@ -126,13 +126,13 @@ fips_sha1_selftest.o: ../../include/openssl/safestack.h fips_sha1_selftest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h fips_sha1_selftest.o: ../../include/openssl/symhacks.h fips_sha1_selftest.c fips_shatest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -fips_shatest.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -fips_shatest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h -fips_shatest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -fips_shatest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -fips_shatest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h -fips_shatest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h -fips_shatest.o: ../../include/openssl/objects.h +fips_shatest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +fips_shatest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +fips_shatest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +fips_shatest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h +fips_shatest.o: ../../include/openssl/err.h ../../include/openssl/evp.h +fips_shatest.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h +fips_shatest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h fips_shatest.o: ../../include/openssl/opensslconf.h fips_shatest.o: ../../include/openssl/opensslv.h fips_shatest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h diff --git a/test/Makefile b/test/Makefile index e8405e95b2..e99e56a572 100644 --- a/test/Makefile +++ b/test/Makefile @@ -88,7 +88,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) $(FIPS_HMACTEST)$(EXE_EXT) $(FIPS_RSAVTEST)$(EXE_EXT) \ $(FIPS_RSASTEST)$(EXE_EXT) $(FIPS_RSAGTEST)$(EXE_EXT) \ $(FIPS_DSSVS)$(EXE_EXT) $(FIPS_DSATEST)$(EXE_EXT) \ - $(FIPS_RNGVS)$(EXE_EXT) $(FIPS_TEST_SUITE)$(EXE_EXT) + $(FIPS_RNGVS)$(EXE_EXT) $(FIPS_TEST_SUITE)$(EXE_EXT) jpaketest$(EXE_EXT) # $(METHTEST)$(EXE_EXT) @@ -104,7 +104,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ $(FIPS_SHATEST).o $(FIPS_DESTEST).o $(FIPS_RANDTEST).o \ $(FIPS_AESTEST).o $(FIPS_HMACTEST).o $(FIPS_RSAVTEST).o \ $(FIPS_RSASTEST).o $(FIPS_RSAGTEST).o \ - $(FIPS_DSSVS).o $(FIPS_DSATEST).o $(FIPS_RNGVS).o $(FIPS_TEST_SUITE).o + $(FIPS_DSSVS).o $(FIPS_DSATEST).o $(FIPS_RNGVS).o $(FIPS_TEST_SUITE).o \ + jpaketest.o SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ @@ -117,7 +118,8 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(FIPS_SHATEST).c $(FIPS_DESTEST).c $(FIPS_RANDTEST).c \ $(FIPS_AESTEST).c $(FIPS_HMACTEST).c $(FIPS_RSAVTEST).c \ $(FIPS_RSASTEST).c $(FIPS_RSAGTEST).c \ - $(FIPS_DSSVS).c $(FIPS_DSATEST).c $(FIPS_RNGVS).c $(FIPS_TEST_SUITE).c + $(FIPS_DSSVS).c $(FIPS_DSATEST).c $(FIPS_RNGVS).c $(FIPS_TEST_SUITE).c \ + jpaketest.c EXHEADER= HEADER= $(EXHEADER) @@ -159,7 +161,7 @@ alltests: \ test_rand test_bn test_ec test_ecdsa test_ecdh \ test_enc test_x509 test_rsa test_crl test_sid \ test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ - test_ss test_ca test_engine test_evp test_ssl test_ige + test_ss test_ca test_engine test_evp test_ssl test_ige test_jpake test_evp: ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt @@ -327,6 +329,10 @@ test_ige: $(IGETEST)$(EXE_EXT) @echo "Test IGE mode" ../util/shlib_wrap.sh ./$(IGETEST) +test_jpake: jpaketest$(EXE_EXT) + @echo "Test JPAKE" + ../util/shlib_wrap.sh ./jpaketest + lint: lint -DLINT $(INCLUDES) $(SRC)>fluff @@ -516,6 +522,9 @@ $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO) $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO) @target=$(IGETEST); $(BUILD_CMD) +jpaketest$(EXE_EXT): jpaketest.o $(DLIBCRYPTO) + @target=jpaketest; $(BUILD_CMD) + #$(AESTEST).o: $(AESTEST).c # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c @@ -643,42 +652,44 @@ exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h exptest.o: ../include/openssl/symhacks.h exptest.c fips_aesavs.o: ../e_os.h ../fips/fips_utl.h ../include/openssl/aes.h fips_aesavs.o: ../include/openssl/asn1.h ../include/openssl/bio.h -fips_aesavs.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h -fips_aesavs.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_aesavs.o: ../include/openssl/fips.h ../include/openssl/lhash.h -fips_aesavs.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -fips_aesavs.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -fips_aesavs.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h -fips_aesavs.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -fips_aesavs.o: fips_aesavs.c +fips_aesavs.o: ../include/openssl/bn.h ../include/openssl/crypto.h +fips_aesavs.o: ../include/openssl/e_os2.h ../include/openssl/err.h +fips_aesavs.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_aesavs.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +fips_aesavs.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +fips_aesavs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +fips_aesavs.o: ../include/openssl/safestack.h ../include/openssl/stack.h +fips_aesavs.o: ../include/openssl/symhacks.h fips_aesavs.c fips_desmovs.o: ../e_os.h ../fips/fips_utl.h ../include/openssl/asn1.h -fips_desmovs.o: ../include/openssl/bio.h ../include/openssl/crypto.h -fips_desmovs.o: ../include/openssl/des.h ../include/openssl/des_old.h -fips_desmovs.o: ../include/openssl/e_os2.h ../include/openssl/err.h -fips_desmovs.o: ../include/openssl/evp.h ../include/openssl/fips.h -fips_desmovs.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_desmovs.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -fips_desmovs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -fips_desmovs.o: ../include/openssl/safestack.h ../include/openssl/stack.h -fips_desmovs.o: ../include/openssl/symhacks.h ../include/openssl/ui.h -fips_desmovs.o: ../include/openssl/ui_compat.h fips_desmovs.c +fips_desmovs.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_desmovs.o: ../include/openssl/crypto.h ../include/openssl/des.h +fips_desmovs.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h +fips_desmovs.o: ../include/openssl/err.h ../include/openssl/evp.h +fips_desmovs.o: ../include/openssl/fips.h ../include/openssl/lhash.h +fips_desmovs.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +fips_desmovs.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +fips_desmovs.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h +fips_desmovs.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +fips_desmovs.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h +fips_desmovs.o: fips_desmovs.c fips_dsatest.o: ../e_os.h ../fips/fips_utl.h ../include/openssl/asn1.h -fips_dsatest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_dsatest.o: ../include/openssl/crypto.h ../include/openssl/des.h -fips_dsatest.o: ../include/openssl/des_old.h ../include/openssl/dsa.h -fips_dsatest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_dsatest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_dsatest.o: ../include/openssl/engine.h ../include/openssl/err.h -fips_dsatest.o: ../include/openssl/evp.h ../include/openssl/fips.h -fips_dsatest.o: ../include/openssl/fips_rand.h ../include/openssl/lhash.h -fips_dsatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -fips_dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -fips_dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -fips_dsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h -fips_dsatest.o: ../include/openssl/sha.h ../include/openssl/stack.h -fips_dsatest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h -fips_dsatest.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h -fips_dsatest.o: ../include/openssl/x509_vfy.h fips_dsatest.c +fips_dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_dsatest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h +fips_dsatest.o: ../include/openssl/des.h ../include/openssl/des_old.h +fips_dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h +fips_dsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_dsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +fips_dsatest.o: ../include/openssl/err.h ../include/openssl/evp.h +fips_dsatest.o: ../include/openssl/fips.h ../include/openssl/fips_rand.h +fips_dsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +fips_dsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +fips_dsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +fips_dsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h +fips_dsatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +fips_dsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +fips_dsatest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h +fips_dsatest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +fips_dsatest.o: fips_dsatest.c fips_dssvs.o: ../fips/fips_utl.h ../include/openssl/asn1.h fips_dssvs.o: ../include/openssl/bio.h ../include/openssl/bn.h fips_dssvs.o: ../include/openssl/crypto.h ../include/openssl/dsa.h @@ -690,20 +701,20 @@ fips_dssvs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h fips_dssvs.o: ../include/openssl/safestack.h ../include/openssl/stack.h fips_dssvs.o: ../include/openssl/symhacks.h fips_dssvs.c fips_hmactest.o: ../fips/fips_utl.h ../include/openssl/asn1.h -fips_hmactest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_hmactest.o: ../include/openssl/conf.h ../include/openssl/crypto.h -fips_hmactest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_hmactest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_hmactest.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_hmactest.o: ../include/openssl/fips.h ../include/openssl/hmac.h -fips_hmactest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -fips_hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -fips_hmactest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h -fips_hmactest.o: ../include/openssl/sha.h ../include/openssl/stack.h -fips_hmactest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h -fips_hmactest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h -fips_hmactest.o: fips_hmactest.c +fips_hmactest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_hmactest.o: ../include/openssl/buffer.h ../include/openssl/conf.h +fips_hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +fips_hmactest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_hmactest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +fips_hmactest.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_hmactest.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +fips_hmactest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +fips_hmactest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +fips_hmactest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +fips_hmactest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +fips_hmactest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +fips_hmactest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +fips_hmactest.o: ../include/openssl/x509v3.h fips_hmactest.c fips_randtest.o: ../e_os.h ../fips/fips_utl.h ../include/openssl/bio.h fips_randtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h fips_randtest.o: ../include/openssl/des.h ../include/openssl/des_old.h @@ -733,73 +744,77 @@ fips_rngvs.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h fips_rngvs.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h fips_rngvs.o: ../include/openssl/x509v3.h fips_rngvs.c fips_rsagtest.o: ../fips/fips_utl.h ../include/openssl/asn1.h -fips_rsagtest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_rsagtest.o: ../include/openssl/conf.h ../include/openssl/crypto.h -fips_rsagtest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_rsagtest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_rsagtest.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_rsagtest.o: ../include/openssl/fips.h ../include/openssl/hmac.h -fips_rsagtest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_rsagtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -fips_rsagtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -fips_rsagtest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +fips_rsagtest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_rsagtest.o: ../include/openssl/buffer.h ../include/openssl/conf.h +fips_rsagtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +fips_rsagtest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_rsagtest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +fips_rsagtest.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_rsagtest.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +fips_rsagtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +fips_rsagtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +fips_rsagtest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +fips_rsagtest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h fips_rsagtest.o: ../include/openssl/sha.h ../include/openssl/stack.h fips_rsagtest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h fips_rsagtest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h fips_rsagtest.o: fips_rsagtest.c fips_rsastest.o: ../fips/fips_utl.h ../include/openssl/asn1.h -fips_rsastest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_rsastest.o: ../include/openssl/conf.h ../include/openssl/crypto.h -fips_rsastest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_rsastest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_rsastest.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_rsastest.o: ../include/openssl/fips.h ../include/openssl/hmac.h -fips_rsastest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_rsastest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -fips_rsastest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -fips_rsastest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +fips_rsastest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_rsastest.o: ../include/openssl/buffer.h ../include/openssl/conf.h +fips_rsastest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +fips_rsastest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_rsastest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +fips_rsastest.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_rsastest.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +fips_rsastest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +fips_rsastest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +fips_rsastest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +fips_rsastest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h fips_rsastest.o: ../include/openssl/sha.h ../include/openssl/stack.h fips_rsastest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h fips_rsastest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h fips_rsastest.o: fips_rsastest.c fips_rsavtest.o: ../fips/fips_utl.h ../include/openssl/asn1.h -fips_rsavtest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_rsavtest.o: ../include/openssl/conf.h ../include/openssl/crypto.h -fips_rsavtest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_rsavtest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_rsavtest.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_rsavtest.o: ../include/openssl/fips.h ../include/openssl/hmac.h -fips_rsavtest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_rsavtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -fips_rsavtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -fips_rsavtest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +fips_rsavtest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_rsavtest.o: ../include/openssl/buffer.h ../include/openssl/conf.h +fips_rsavtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +fips_rsavtest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_rsavtest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +fips_rsavtest.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_rsavtest.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +fips_rsavtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +fips_rsavtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +fips_rsavtest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h +fips_rsavtest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h fips_rsavtest.o: ../include/openssl/sha.h ../include/openssl/stack.h fips_rsavtest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h fips_rsavtest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h fips_rsavtest.o: fips_rsavtest.c fips_shatest.o: ../fips/fips_utl.h ../include/openssl/asn1.h -fips_shatest.o: ../include/openssl/bio.h ../include/openssl/buffer.h -fips_shatest.o: ../include/openssl/conf.h ../include/openssl/crypto.h -fips_shatest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -fips_shatest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -fips_shatest.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_shatest.o: ../include/openssl/fips.h ../include/openssl/lhash.h -fips_shatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -fips_shatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -fips_shatest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h -fips_shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h -fips_shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -fips_shatest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -fips_shatest.o: ../include/openssl/x509v3.h fips_shatest.c +fips_shatest.o: ../include/openssl/bio.h ../include/openssl/bn.h +fips_shatest.o: ../include/openssl/buffer.h ../include/openssl/conf.h +fips_shatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +fips_shatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +fips_shatest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +fips_shatest.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_shatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +fips_shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +fips_shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +fips_shatest.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h +fips_shatest.o: ../include/openssl/sha.h ../include/openssl/stack.h +fips_shatest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h +fips_shatest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h +fips_shatest.o: fips_shatest.c fips_test_suite.o: ../fips/fips_utl.h ../include/openssl/aes.h fips_test_suite.o: ../include/openssl/asn1.h ../include/openssl/bio.h fips_test_suite.o: ../include/openssl/bn.h ../include/openssl/crypto.h fips_test_suite.o: ../include/openssl/des.h ../include/openssl/des_old.h -fips_test_suite.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h -fips_test_suite.o: ../include/openssl/err.h ../include/openssl/evp.h -fips_test_suite.o: ../include/openssl/fips.h ../include/openssl/hmac.h -fips_test_suite.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -fips_test_suite.o: ../include/openssl/objects.h +fips_test_suite.o: ../include/openssl/dh.h ../include/openssl/dsa.h +fips_test_suite.o: ../include/openssl/e_os2.h ../include/openssl/err.h +fips_test_suite.o: ../include/openssl/evp.h ../include/openssl/fips.h +fips_test_suite.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +fips_test_suite.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h fips_test_suite.o: ../include/openssl/opensslconf.h fips_test_suite.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h fips_test_suite.o: ../include/openssl/rand.h ../include/openssl/rsa.h @@ -820,6 +835,14 @@ ideatest.o: ../include/openssl/opensslconf.h ideatest.c igetest.o: ../include/openssl/aes.h ../include/openssl/e_os2.h igetest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h igetest.o: ../include/openssl/rand.h igetest.c +jpaketest.o: ../include/openssl/bio.h ../include/openssl/bn.h +jpaketest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +jpaketest.o: ../include/openssl/err.h ../include/openssl/jpake.h +jpaketest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h +jpaketest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +jpaketest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +jpaketest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +jpaketest.o: jpaketest.c md2test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h md2test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h md2test.o: ../include/openssl/evp.h ../include/openssl/fips.h |